Comments (5)
pytest
itself depends on packaging, so I suspect that is the issue. Are you installing pytest from a custom resolve?
If so, you can set the packaging version in that resolve's lockfile inputs.
One convenient way to do this is to add pytest
to your python_rasa resolve (it may already be there because your tests probably import from it?) and then set:
[pytest]
install_from_resolve = "python_rasa"
# Enumerate the requirements that pytest actually needs to run itself.
# If you don't it will use the entire lockfile, which means every lockfile change will invalidate all tests.
requirements =[...]
from pants.
You nailed it! Using install_from_resolve = "python_rasa"
in the toml file does the trick.
Can you think of any way in which I can force this project tests to use the project's resolve pytest or to override the pytest resolve for such tests? I need to keep the rest of the projects with the same pytest setting. Specifying the resolve in the test folder build file like this is not having the expected effect:
projects/chatbot/tests/BUILD
python_tests(
name="tests",
resolve="python_rasa"
)
from pants.
Unfortunately that is not currently possible - the resolve that pytest runs from is set globally. However this is a much-requested feature in the New Python Backend discussions. Feel free to chime in there.
For now, probably best is to generate a custom pytest lockfile that pins packaging
.
This is an unfortunate problem with pytest - it loads the code under test into the same namespace as its own code. Really, it should "shade" itself and its dependencies.
from pants.
Thanks a lot for your guidance was very valuable. We got everything working following your advice
from pants.
Glad to hear it! Hopefully in the future this will be handled more smoothly.
from pants.
Related Issues (20)
- Corepack package manager installation is not captured
- Pants log level stuck as DEBUG HOT 6
- Generate lockfiles doesn't work with an empty requirements file HOT 4
- Create a Github CI action that automatically updates example repos on stable release
- Folders denoted as `append_only_caches` not accessible in `output_digest` HOT 1
- Add "Common tasks" contributing docs HOT 2
- [Call-by-name] Investigate using concrete syntax trees for migration code
- [Call-by-name] pathlib subpath exception when using migration outside of main pants repo
- Files encompassed as part of `output_directories=(".",)` can be hard links without write permissions
- Python provider not used for `pants package` of `pex_binary` target HOT 1
- Install failed for pants plugin HOT 4
- "list" options having bad error messages when used like a "dict". HOT 1
- Support testing a `python_distribution` HOT 1
- Error installing on alpine HOT 4
- [Call-by-name] Backend migration tracking list
- [Call-by-name]: Migration does not handle multiple MultiGet in the same line HOT 1
- [Call-by-name] Handle implicitly cases better
- Proposal: consider dropping support for macOS 10.15 & macOS 11 HOT 1
- Using resolves_to_only_binary causes "Resolving wheels was disallowed..." error in 2.21
- Docker registry aliases not available inside `cache_from`/`cache_to` inside macro
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 pants.