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

Add testenv:dev to create development environment #765

Merged
merged 1 commit into from Jun 13, 2021

Conversation

@bhrutledge
Copy link
Contributor

@bhrutledge bhrutledge commented Jun 12, 2021

This is scratching an itch of mine. It feels a bit exotic, but I saw some prior art in virtualenv and build. I think it might be less exotic if we specified dependencies in extras_require or requirements files.

This allows VS Code to automatically detect my virtual environment, and use pytest/black/flake8 etc. directly from there while I'm editing individual files.

@sigmavirus24
Copy link
Member

@sigmavirus24 sigmavirus24 commented Jun 12, 2021

👍 Mostly because I had a tox -e venv which did 99.9% of this (it didn't print the executable version) and was removed at some point

Loading

@jaraco jaraco changed the base branch from master to main Jun 12, 2021
@jaraco
Copy link
Member

@jaraco jaraco commented Jun 12, 2021

In my workflow, I have TOXENV=python, so tox --notest creates a development environment (and also a test environment for the default python), thus avoiding the added complication of orchestrating these environments and leading to a pretty simple tox config. I'm okay with this project creating arbitrarily complex tox configuration, but I'll personally be using testenv for the latest stable Python for 99% of my workflows.

Loading

@bhrutledge
Copy link
Contributor Author

@bhrutledge bhrutledge commented Jun 12, 2021

In my workflow, I have TOXENV=python, so tox --notest creates a development environment (and also a test environment for the default python)

I'm definitely in favor of simplifying things, but if I understand correctly, this only installs the [testenv]deps, and could also be accomplished with tox --devenv venv. I'd like one virtual environment with pytest, black, flake8, etc. This approach is also lightly documented by tox.

Loading

@sigmavirus24
Copy link
Member

@sigmavirus24 sigmavirus24 commented Jun 12, 2021

It's also relatively widespread in projects of any size and complexity (see also OpenStack and I believe Apache projects)

Loading

@bhrutledge
Copy link
Contributor Author

@bhrutledge bhrutledge commented Jun 12, 2021

@gaborbernat If you're feeling generous with your time, I'm curious what you think of this, as a maintainer of virtualenv and tox.

Loading

@gaborbernat
Copy link

@gaborbernat gaborbernat commented Jun 13, 2021

Not sure what's the question, but I personally do prefer what this PR proposes. I've seen what @jaraco does, but I'd consider that a bit anti-pattern, though subjective at the end of the day, as it does not allow you to easily separate and recreate every python installation (could be just my experience, but version-specific bugs happen ever so often, and then it's good to quickly and easily reproduce them on your local machine).

Loading

@bhrutledge
Copy link
Contributor Author

@bhrutledge bhrutledge commented Jun 13, 2021

Not sure what's the question, but I personally do prefer what this PR proposes

Thanks @gaborbernat; no specific question. I was just wondering what your overall impression was, for example if you had any suggestions for improvement or caveats to be aware of.

Loading

@bhrutledge bhrutledge merged commit 3163fd0 into pypa:main Jun 13, 2021
23 checks passed
Loading
@bhrutledge bhrutledge deleted the tox-dev-venv branch Jun 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants