Comments (3)
@miketheman Great question--there's two parts to this answer:
- How to get poetry to add a
tests_require
key in the generatedsetup.py
? I did some digging, and I could not figure out an answer--for some reason, nobody else has asked this question, and the current version of Poetry doesn't seem to have this feature documented anywhere, even if it has it. There was python-poetry/poetry#1644 raised on the Poetry repository, in response to which "dependency groups" were recently implemented in the (unstable) development branch of Poetry (see also python-poetry/poetry#1856 (comment)) and documented here, but this feature is not released yet, and it's unclear as to whether Poetry itself will actually make use of this feature in itssetup.py
generation step. There are also some suggestions here and there to specify test dependencies in atest
key undertool.poetry.extras
, but then it gets treated not as a test dependency so much as just a regular optional dependency. - OS vendors specifically know about test dependencies because they are all manually specified upon being added to the package repository (as such, packages generally require manual attention from maintainers in the sense of manually checking upstream for updates, making sure dependencies are correct, etc.) As an example, you can see the line that specifies the test dependencies for
python3-wheel
in thevoid-packages
repository here: https://github.com/void-linux/void-packages/blob/5f0ed9f35fbbf2313205b2fc942942c870739e04/srcpkgs/python3-wheel/template#L9. So from the vendor perspective it's not essential forsetup.py
to actually specify test dependencies (since they are manually recorded); only for the sdist bundle to include the test files so it can run them.
On a related note: the tests_require
key in setup.py
has been long since deprecated--not sure why--but also seems to have reappeared as an allowed key in the newer setup.cfg
configuration format? Not sure what's going on there, but it seems from the first decision to deprecate tests_require
in setup.py
that those folks are not interested in specifying test dependencies within setup.py
either.
from pytest-socket.
@kwshi Thank you for raising this!
I appreciate the position package vendors have in this regard.
Reading more about this inclusion, I don't understand how the source distribution will know which test dependencies to install, as I do not see hat key in the generated setup.py file.
These dependencies are necessary for the project to run tests, how does the package vendor get notified of them?
from pytest-socket.
@kwshi Excellent response, thanks! I'll be happy to incorporate this change soon and release a patch version package.
from pytest-socket.
Related Issues (20)
- Incompatibility with pytest-flakes? HOT 2
- `remove_host_restrictions` functionality no longer in the public interface HOT 3
- 0.5.0: pytest is failing in `tests/test_async.py::test_starlette` unit HOT 4
- pytest-socket blocks retrieving other dependencies HOT 1
- Issue with sockets when trying to run Home Assistant tests HOT 2
- 0.5.1: pytest is failing in `tests/test_async.py::test_httpx_fails` unit HOT 11
- Question about asynctest and Python 3.8+ compatibility HOT 3
- Action Required: Fix Renovate Configuration
- dd-trace calls in separate thread do not fail test HOT 7
- Allow host masks HOT 2
- Allow private networks only HOT 5
- Issue with latest pytest-socket version while using testcontainers HOT 6
- Try replacement for httpbin HOT 1
- Do not install files directly to site-packages HOT 2
- --allow-hosts list is normalized but connection host is not HOT 5
- Update Python version support HOT 1
- vscode-python version 2023.20.0 breaks disable_socket expected behavior HOT 2
- Option to only block `connect` calls? HOT 2
- 0.7.0: test suite fails HOT 6
- pytest-socket raises IndexError when used with httpx
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pytest-socket.