-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
support for testing / staging environments #1007
Comments
I believe that was some intention to keep number of environments small to minimize complexity. Can you provide some examples of dependencies that you need in your staging environment but not production? |
@yunti You might want to practice 5 Whys on this and/or revisit 12-Factor Application and related ideas... Do you really need to have any divergence between requirements for different envs? We all know why there's a 'dev' option, that is relevant to keeping test runners etc out of production if they can be. Unclear how/why there would be a general need for staging/etc. I'm not looking for an answer in the abstract. I'm nudging you to go through literally each difference in these dependency lists, and see if there is even 1 that truly could not be installed in the other envs. If so, and you can bring it up concretely, it would be very useful to the thread. |
Even if there are concrete valid use cases -- would |
for example, in local development, I need IPython and pytest, so maybe in pyproject.toml I can add them to dev dependencies, but when it's in CI test for production deployment, properly I dont need to install IPython.
As it was discussed before, extras doesn't mean for this purpose (sdispater's comment, #759) I think Poetry should support something like |
In the best world, we don't need such a thing as multiples environment but as a developer in a corporate company, we are forces to develop in ..Windows !! And there is python packages that don't work on Windows and have a replacement package just for that shitty OS. Example : |
A related case here is defining dependencies for building documentation. For example, I normally define Right now the only way of achieving the above behaviour is by adding the docs dependencies to Sphinx = {version = "^2.2.1", optional = true}
sphinx_readable_theme = {version = "^1.3.0", optional = true} and then define them in I think the multitude of examples and issues about how this limitations breaks so many workflows is proof that this behaviour should be reconsidered. |
This is a concrete issue when testing against different Python implementations. If you have mypy as a development dependency for type checking, then you're unable to install the development environment with PyPy because typed_ast is incompatible. If you want to test against Python 3.5, then you can't install black. Adding your linting development dependencies as optional production dependencies and then needing to run extra commands in your normal development environment feels like a major workaround. It would be more natural for these development dependencies to be opt-out rather than opt-in. It would be nice if we could do something like this on CI. # When testing against PyPy.
poetry install --ignore mypy
# When testing against Python 3.5.
poetry install --ignore black Another alternative would be specifying mypy = {version = "^0.740.0", optional = true} in |
I have another use case: a package that is protected because it is an important part of the intelectual property of the company. The package is not available for development but should be installable on production. |
well, the |
Cross-posting this from #1644: Oh yes, this is exactly what I've been missing in poetry. Groups as well as individual deps that I need to install on their own or together with the production code. I use poetry to setup multiple tox environments with isolated builds in tox.ini, and I currently need to wait for ~100 deps to be installed for each (!!!) tox env. The total installation time alone is many times longer than what it takes to run all tests. This feature would cut a large chunk out of the total wait time, and would probably be more valuable to me than speeding up the general installation time, which is something I understand is being worked on at the moment. |
I'm also looking to reduce CI/CD installation times. Linting takes 10 seconds, running the test suite 16 seconds, but installing poetry and all the dev dependencies takes 2 minutes 20 seconds. The CI/CD steps don't need a lot of the dev dependencies, the test step doesn't need the linting dependencies, and the linting step doesn't need the testing dependencies. Yet, a developer will need all the dev dependencies. Extras don't really fit this case, as there is overlap in what each use-case needs to install and extras are listed in the distributed package (where they don't belong, these are dev dependencies). We basically have two fixed groups of dependencies right now: install dependencies and dev dependencies. Can we please have support for any number of groups, with install and dev being the base defaults? Together with a simple group inclusion syntax, that would cover all our needs here. The alternative right now is to maintain separate requirements files just for the CI/CD environment for use with Side note: I see several calls here for this feature because they have dependencies that don't work in certain environments. Those cases (@sangaline named E.g. here's a [tool.poetry.dev-dependencies.black]
version = "19.10b0"
allow-prereleases = true
python = "^3.6"
markers = "platform_python_implementation == 'CPython'" |
I note that this is very closely related to #1644, which specifically calls for group support. |
This should be resolved with introduction of groups. Closing in favour of #1644. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Feature Request
We use several requirements files for testing staging etc.. including dev and production. Can poetry support such a setup?
The text was updated successfully, but these errors were encountered: