You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Based on the discussion in #1829, I thought it would be best to clear up some of the confusion in the developer's guide about running tests and test dependencies. I realized while commenting on that issue that tests_require in setup.py no longer serve any purpose as we don't use python setup.py test to run our tests. As far as I can tell there is no fully supported way currently to define your test dependencies except as an "extra" in setup.py.
As part of this work I looked into how you are supposed to define things in pyproject.toml. Although there are some examples, it didn't seem like a fully supported method. I mean, completely replacing our setup.py static information with metadata in pyproject.toml seems like more work and seems like it may not be fully supported by pip and other tools right now. I think we can save that for a later time and let larger projects run into the gotchas first. I know projects like xarray already define everything in their setup.cfg.
I'm not a fan of lock files so if we switched or added poetry configuration in the future I would prefer not to commit the lock file.
I'd still probably do everything with conda even if we had poetry config added. I wouldn't be surprised if there is a poetry plugin or work on conda to install dependencies from a pyproject.toml.
I like that poetry's documentation is all pyproject.toml. I think it used to be a separate file.
Is it possible to do "extras" with poetry beyond the dev dependencies?
I'm sure we could list both setuptools/pip deps and poetry deps in a single pyproject.toml file. That wouldn't be that bad. I wonder if TOML has aliases/shortcuts that would even get rid of the duplicate lists of deps.
Does possibly wanting poetry in satpy mean that this PR is not ready for merge?
yes, the lock file should probably be in the .gitignore
I don't see poetry as a hinder. When you do poetry publish it just creates a pip-compatible distribution and puts it on pypi, from which conda just takes over to create a conda package. So poetry is really just a way to manage the package when you develop it the way I see it.
What would be the use case for having both? still be able to do pip install -e .? because I think that would be the only thing that need to change, along with poetry run pytest instead of pytest .
I think the build-system would be different for poetry, but the rest is fine I guess
For reference, the pyproject.toml file of my local package (which is a satpy plugin):
Sorry, I meant a fancy understanding by conda where you could go conda env create -n my_satpy_env --from-pyproject=pyproject.toml and it would create/install/update the dependencies by reading the pyproject configuration. Even if supporting pip, poetry, and conda meant three separate lists of dependencies at least they'd be in one place.
Github is forcing my numbering so this is a placeholder...
...
Supporting users of pip and users of poetry with as small of a burden on us (at least that's the hope). For the pytest call, can't we have two separate calls, one for installing test deps and one for running the tests? Then we can still use pytest directly. Not sure if there is a benefit to that, but still wanted to mention it. This goes back to the conda point where I'm not sure I like the idea of depending on PyPI packages for all dependencies since we have so many complex compiled dependencies.
I think switching to poetry is a bigger PR and this PR is a relatively simple change. That's why I asked.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Based on the discussion in #1829, I thought it would be best to clear up some of the confusion in the developer's guide about running tests and test dependencies. I realized while commenting on that issue that
tests_require
insetup.py
no longer serve any purpose as we don't usepython setup.py test
to run our tests. As far as I can tell there is no fully supported way currently to define your test dependencies except as an "extra" insetup.py
.As part of this work I looked into how you are supposed to define things in
pyproject.toml
. Although there are some examples, it didn't seem like a fully supported method. I mean, completely replacing our setup.py static information with metadata in pyproject.toml seems like more work and seems like it may not be fully supported bypip
and other tools right now. I think we can save that for a later time and let larger projects run into the gotchas first. I know projects like xarray already define everything in theirsetup.cfg
.For reference: https://www.python.org/dev/peps/pep-0621