Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Development dependencies in setup.py #1483

Closed
YannickJadoul opened this issue Oct 11, 2022 · 1 comment · Fixed by #1484
Closed

Development dependencies in setup.py #1483

YannickJadoul opened this issue Oct 11, 2022 · 1 comment · Fixed by #1484
Assignees
Labels
Milestone

Comments

@YannickJadoul
Copy link
Contributor

I have noticed I'm not the first one to bring it up, but install_requires contains a number of dependencies used for the development of abjad (i.e., Sphinx and extensions, pytest and extensions, isort, black, ...), but unnecessary to simply use the library.

I've found this being addressed and solved in #468, but it seems it was reverted again in #1295 and 3b6d36f. So I was wondering if there was any explicit reason these changes got reverted over the years?

I'm bringing this up because we were considering to depend on abjad for a new Python library we're developing, but then I suddenly noticed my development tools being updated when installing abjad. A few reasons for that:

  • It was very unexpected and slightly annoying that while I'm not trying to develop/build/test abjad, my build tools get updated because abjad not only installs these, but also enforces a minimal version. E.g., it is not possible to install abjad and keeping my version of Sphinx pinned to a lower version (within the same virtualenv).
  • If we would make abjad a runtime dependency of the new project (as we would like to do), it would also install all the (unnecessary) dependencies of abjad. Keeping dependencies (and dependencies of dependencies and ...) to the minimum would be nice, as any of our future users would also automatically drag in all dependencies of abjad. And frankly, as a user, I'd be wary of a "simple library" dragging in so many extra tools.
  • install_requires seems just by its name to be the wrong location for this, as these are not runtime dependencies (setuptools says: "where a package declares its core dependencies, without which it won’t be able to run.")? It seems Python packages typically use requirements.txt or extras_require (see for example here or here)

So, TL;DR: would you accept a PR (I'm happy to create it) that would take the non-runtime, development dependencies out of setup.py's install_requires and into requirements.txt or back into a dev extras_require?
Without trying to arrogantly tell you how your Python project should be organized (people have different ways of working and you're doing all the work and making the library freely available, after all!), it would be nice to be able to install and use abjad without installing or affecting the versions of my development tools.

@trevorbaca
Copy link
Member

Hi @YannickJadoul yes, if you have time go ahead isolate the development dependencies in a dev extras_require. It's time to go back to allowing a minimal-dependency install for projects that need / want it. Nothing presumptive about the recommendation; you make a good argument to allow other projects to treat Abjad as something close to a library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants