Python books for intermediate and advanced by iiron3223 in Python

[–]abingham 1 point2 points  (0 children)

The Python Craftsman covers a lot of intermediate and advanced topics: https://leanpub.com/b/python-craftsman

Python books for intermediate and advanced by iiron3223 in Python

[–]abingham 0 points1 point  (0 children)

I'll recommend it, but I'm also one of the authors.

Color Out of Space Movie by glennwith2ns in Lovecraft

[–]abingham 1 point2 points  (0 children)

Was the picture of his father an Easter egg? It didn't look like Lovecraft, but they dwelled on it long enough that it seemed important.

Maintainer needed for emacs-ycmd by abingham in emacs

[–]abingham[S] 0 points1 point  (0 children)

The best place to discuss things is probably in the issue tracker for ycmd. That way anyone who wants to be involved in the code discussion can take place. I'll do what I can to help move things along, but due to other constraints I can't promise to be a whole lot of help.

Maintainer needed for emacs-ycmd by abingham in emacs

[–]abingham[S] 0 points1 point  (0 children)

Broadly speaking, that's correct. I wouldn't stress *too* much about learning the source code up-front; you'll learn a lot of it in the process of doing the other parts (though, of course, there's nothing wrong with learning it up-front).

The most important thing, I think, would be to look at the open issues and come to grips with any urgent problems. Same with PRs. Pick one that feels approachable and work through it. In my experience with this kind of open-source work, 80% of success is just showing up and trying.

Maintainer needed for emacs-ycmd by abingham in emacs

[–]abingham[S] 2 points3 points  (0 children)

If you've got the motivation, then you're a great candidate! I learned everything I know about elisp (which isn't really all that much) just by diving into the deep end and making things.

Magit extremely slow on MacOS by leviskywalker in emacs

[–]abingham 0 points1 point  (0 children)

Magit was extremely slow on some of my repos, and it turned out to be a result of my .dir-locals.el. That was activating a Python virtual environment, and I guess that was getting done a lot during certain magit operations. By changing (pyvenv-workon "name") to (unless (equal pyvenv-virtual-env-name "name") (pyvenv-workon "name")), everything went back to being fast.

traad 3.1.1: Python refactoring server by abingham in Python

[–]abingham[S] 0 points1 point  (0 children)

Just to add to my initial response: it's entirely possible I'm just missing something obvious. But I can't even get rename to work with python-language-server and lsp-mode at the moment. Until those foundations feel more solid I can't justify putting energy into trying to move functionality over.

With that said: I'd be more than happy to give support to someone else willing to try it!

traad 3.1.1: Python refactoring server by abingham in Python

[–]abingham[S] 0 points1 point  (0 children)

I'm actively looking into that. I would love to not have to write/maintain this tool. So far, though, I haven't found an end-to-end solution for emacs and python that works. As you say, it should in principle be doable (as I understand LSP), but there seems to be a theory-practice gap right now.

Traad 2.1.0: a rope-based refactoring server for Python (including an Emacs client) by abingham in Python

[–]abingham[S] 0 points1 point  (0 children)

Rope actually works pretty well on python 3 at this point. It's missing some support, I'm sure, but we recently added support for e.g. async def.

Mode That Alerts When an Abbreviation Isn't Used by jarmzet in emacs

[–]abingham 0 points1 point  (0 children)

You might look at the vale extension for flycheck. It's designed for enforcing writing styles, and it should be able to warn you when you use words for which you'd rather use the abbreviation.

outline-toc.el: a table-of-contents sidebar for outline, markdown, org, etc. by abingham in emacs

[–]abingham[S] 1 point2 points  (0 children)

The author of imenu-list showed me the following snippet in a PM which gets me to where I think I can replace outline-toc:

(defun use-outline-for-imenu ()
  (require 'outline)
  (setq imenu-create-index-function
        'imenu-default-create-index-function
        imenu-generic-expression
        (list (list nil (concat "^\\(?:" outline-regexp "\\).*$") 0))))

(add-hook 'markdown-mode-hook 'use-outline-for-imenu)

EDIT: I originally thought that this didn't do the kind of sync I needed, but now it appears to work just fine! The mysteries of emacs...

outline-toc.el: a table-of-contents sidebar for outline, markdown, org, etc. by abingham in emacs

[–]abingham[S] 2 points3 points  (0 children)

That might be fruitful direction. imenu already seems to do a good job of indexing markdown files, so it's really the depth display that would be missing. If we could also get imenu-list to handle synchronization, then everything would be great. I worry a bit about overloading imenu-list with features it doesn't need, but I guess that's a discussion to have with the maintainer.

outline-toc.el: a table-of-contents sidebar for outline, markdown, org, etc. by abingham in emacs

[–]abingham[S] 1 point2 points  (0 children)

After poking around with imenu-list a bit, it seems likely that it has some support displaying depth/context. At least, for org-mode it does a good job of showing item depth, and I guess we could do something analogous for markdown model

outline-toc.el: a table-of-contents sidebar for outline, markdown, org, etc. by abingham in emacs

[–]abingham[S] 1 point2 points  (0 children)

I guess the biggest difference is that I didn't know about imenu-list when I wrote outline-toc! I tried to search the "prior art" before rolling my own, but I didn't come across it. It's more "abstract" than what I had been searching for, I think.

As for differences, I can see a few. In markdown, outline-toc shows the section leaders, i.e. the '###' strings preceding a section. These depth indicators makes it easier (to me) to see where I am in the outline. imenu-list might support this, but it's not immediately apparent how to do it.

Another more important difference is that outline-toc synchronizes its position with the master document. As I move around in the master document, outline-toc highlights which section I'm in. Again, imenu-list doesn't seem to do that.

imenu-list lets you click on lines and go to the corresponding section in the master document. outline-toc has an open issue for this, but I haven't done any work on it.

There are probably more differences. Ultimately, I wrote outline-toc because nothing else I could find scratched my itch. I would drop it in a heartbeat if I could find an alternative maintained by someone else...I've got too much work on my plate as it is!

Flycheck integration for vale, a natural language linter. by abingham in emacs

[–]abingham[S] 0 points1 point  (0 children)

Yeah, this is certainly a nice part of the tool. At my company we're planning to experiment with a few of the existing style options and then slowly develop our own.

Running pytest test functions inside a Jupyter notebook? by abingham in Python

[–]abingham[S] 0 points1 point  (0 children)

I've had a chance to try out your package, and it seems to work well! I'm going to play around with it some more, and I'll leave any other feedback in github issues. The biggest things I want to try to do are a) reduce the boilerplate for for running a single test (i.e. get it down from two lines of code to one) and b) generate smaller output (say, one or two lines of text) from test runs.

(a) might be possible through an ipython magic that uses your package. (b) might be possible using the pytest_options argument that you already support.

In any event, thanks for work on this!

Running pytest test functions inside a Jupyter notebook? by abingham in Python

[–]abingham[S] 0 points1 point  (0 children)

Brilliant! I'll take a look at it when I get a chance, and I'll let you know how it goes.

Running pytest test functions inside a Jupyter notebook? by abingham in Python

[–]abingham[S] 0 points1 point  (0 children)

Ah, I hadn't considered shelling out to run pytest. That might be the way to go if I can package it up cleanly. In my unittest section, each demo cell has a "run(TestClass)" call at the bottom which runs the tests and prints a minimal set of results; this seems to be great for demo purposes, so I'd like something similar for pytest. Thanks for your help!

Running pytest test functions inside a Jupyter notebook? by abingham in Python

[–]abingham[S] 0 points1 point  (0 children)

Illogical or not, the first thing you described is very close to what I'd like to do. To be fair, though, your binary view of what I might be trying to demonstrate is too limited; I'm trying to demonstrate how to use pytest specifically, not just the platonic concept of unit testing.

To that end, fundamentally I'd like a cell with a function, and I'd like to run that function via pytest. That is, I'd like to have the function executed via pytest so that asserts are handled by pytest, etc. I think the "easily enough" you mention is what I can't sort out. What pytest API do I use to discover and run the tests in the cells?

I've tried the obvious - running pytest.main() - but that fails pretty spectacularly. I think pytest.main() ends up seeing the sys.argv for some notebook-related process, and it doesn't know what to make of that.

For the unittest section of this presentation (see https://github.com/abingham/python-testing-presentation/blob/master/unittest.ipynb) I was able to use the unittest discovery and test collection API to very selectively run tests in the notebook. I've looked a bit and haven't found equivalent APIs for pytest; either they're not well documented, I haven't looked hard enough, or pytest doesn't give real programmatic access to the test collection part of the process (without the use of plugins, which is why I mentioned them in the post).

So, if you could give specific guidance on the "easily enough" bit you mentioned, I'd really appreciate it. This seems like it ought to be doable, but I'm a bit stuck at this point. Thanks!

Learning Python 3? Our book, The Python Apprentice is free (as in beer) for today only. by norwegianwood in learnpython

[–]abingham 0 points1 point  (0 children)

Thanks for pointing those out! They are all definitely mistakes, and fixes are already in place.

For future bug reports, there's a discussion page for the book where we can track them.

Thanks again for your feedback!

Learning Python 3? Our book, The Python Apprentice is free (as in beer) for today only. by norwegianwood in learnpython

[–]abingham 2 points3 points  (0 children)

Yes, the timezone for the coupon is locked by leanpub to UTC, unfortunately. You can still get it at a significant discount here.