Closed POD666 closed 1 year ago
Thanks for the issue.
We switched the dependency from toml to tomli in 1.2.7, I imagine that's what's causing this.
Could the issue be solved just by removing the reference to [toml] in your requirements file?
Nope, the issue persists.
I can reproduce it with any version
$ pip install import-linter==1.8.0 --only-binary=:all:
ERROR: Could not find a version that satisfies the requirement import-linter==1.8.0 (from versions: none)
ERROR: No matching distribution found for import-linter==1.8.0
PS: only reproducible if the specified version is not yet installed, otherwise Requirement already satisfied ...
is printed.
I commented out import-linter from my dev.requirements.in file and pip-compile succeded without issues.
So only import-linter leads to the issue.
Without import-linter in dev.requirements.in everything works except pre-commit.
We have a bit custom version of it to discover all packages but that is another story.
If you could publish whl, that would be perfect 🙏
Thanks.
To be honest, it's the first time I've encountered --only-binary=:all:
, and haven't before considered distributing wheels, since Import Linter is pure Python, so I'm straying outside my area of knowledge here. So I'd definitely consider distributing wheels, but there is some learning I'll need to do first.
I'm guessing the source of the problem might be something to do with the way the new dependency tomli
is distributed?
Interested to hear more about why you use --only-binary=:all:
, and if you have any other insights as to why this has started breaking.
I don't think it's related to tomli. --only-binary=:all:
is looking for whl in pypi and you didn't publish any.
I want to use pip with --platform
flag and it requires using --only-binary=:all:
too.
Why this has started breaking
It didn't start breaking. It was never working and I never had a need to use --only-binary=:all:
.
Something new I'm trying to implement is generating requirements constraints for developers in CI: in CI linux is used but developers use darwin. When packages have platform-specific requirements it leads to issues (different constraints generated locally and in CI). That is why I'm trying to use pip ... --platform
and that is why I'm forced to use --only-binary=:all:
.
Building whl should be pretty easy, we have the following script (it's used for each module separately):
echo "Building '${MODULE}'..." ;
# Build *.tar.gz and *.whl packages:
(cd ${MODULE} && python setup.py sdist bdist_wheel);
mv ${MODULE}/dist/* dist-python/;
Then publishing to pypi looks like this (we use twine):
twine upload --verbose ${TWINE_EXTRA_ARGS} -r pypi dist-python/*;
Hope it helps 🙂
Thanks for the clarification - I want to think about it more, but I imagine I will publish wheels at some point.
I have just published a wheel for 1.8.0. Could you let me know if this resolves your problem, and I will continue to do it for future releases?
pip install import-linter
is instantaneous now ✨
Great!
Hi,
In shot, this fails:
I need to build requirements constraints for a platform that is different from one used in CI and my script fails at import-linter.
More details
I'm using `pip-compile` in CI with linux image and I want to build dev.requirements.txt for developers who use darwin: ``` $ pip-compile -v dev.requirements.in -o dev.requirements.txt --allow-unsafe --pip-args "--platform darwin --only-binary=:all: --target $${VIRTUAL_ENV}-darwin" ... pip._internal.exceptions.DistributionNotFound: No matching distribution found for import-linter[toml]==1.2.7 (from -r dev.requirements.in (line 11)) ``` More specific command to reproduce is: ``` $ pip install import-linter[toml]==1.2.7 --platform darwin --only-binary=:all: --target ${VIRTUAL_ENV}-darwin ERROR: Could not find a version that satisfies the requirement import-linter[toml]==1.2.7 (from versions: none) ERROR: No matching distribution found for import-linter[toml]==1.2.7 ```Could you publish whl to pypi?