-
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
[InvalidRequirement] Invalid requirement, parse error at "'extra =='" #2326
[InvalidRequirement] Invalid requirement, parse error at "'extra =='" #2326
Comments
@simonepri I was able to use the add command without errors on a linux machine. I suspect this might be an issue with transformer Could you see if you can execute |
I tried on Ubuntu and it produces the same error: https://colab.research.google.com/drive/1xUMhXL1iPiJjAgLMAN8OzJk21SGGhGQR
On macOS running: git clone https://github.com/huggingface/transformers
cd transformers
git checkout a21d4fa410dc3b4c62f93aa0e6bbe4b75a101ee9
python setup.py egg_info gives the following: running egg_info
creating src/transformers.egg-info
writing src/transformers.egg-info/PKG-INFO
writing dependency_links to src/transformers.egg-info/dependency_links.txt
writing requirements to src/transformers.egg-info/requires.txt
writing top-level names to src/transformers.egg-info/top_level.txt
writing manifest file 'src/transformers.egg-info/SOURCES.txt'
reading manifest file 'src/transformers.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'src/transformers.egg-info/SOURCES.txt' |
This is the value of poetry/poetry/version/requirements.py Lines 207 to 214 in e8b6e15
|
It seems that when a url is provided the cc: @sdispater |
@simonepri most of that was copied over from the packaging project. I believe it is a side-effect of using [dev]
...
isort@ git+git://github.com/timothycrosley/isort.git@e63ae06ec7d70b06df9e528357650281a3d3ec22#egg=isort
... To this;
As per PEP-508;
The wheel METADATA will contain this;
The fix here, I think should be to ensure we add a whitespace prefix for the semicolon as expected. |
After the fix you suggested, the
But then this string is fed into
Thus we also need to change this: |
@abn I noticed that all the tests strings do not have a space before the Shall I change them as well together with the new PR? The reason why they all pass is that the It seems weird to me that we have a grammar that allows for both |
Also, I couldn't find any tests for the |
I agree that the grammar could be improved, but at the moment I am reluctant to make changes to that module since I am not entirely sure if we should replicate the logic and would like to look at reusing For now, I am inclined to keep the grammar as is until we decide on how we should proceed on the broader case. As for tests, I would retain the existing tests, but also add extra ones to ensure that a whitespace is also supported. The |
I agree that reusing their code makes a lot of sense. Anyway, I think is worth opening an issue on their side to ask wether that is intentional or not. If you look at their test they indeed add a space for urls: But then in the |
Our fix is simply working around the issue. The root issue is definitely the grammar, the regex is a bit too greedy and should be fixed eventually. Let's see what happens with the issue upstream. |
I think the reason why the grammar behaves like that is because of the following example, that should be a valid url:
I was actually wrong, they do add the space when they stringify the object, the thing is that they only do that for URLs. |
It is tested in |
Yes please. |
Prior to this fix, when formatting PEP 508 dependency specification for remote url references, the quoted marker was not prefixed with required whitespace. This change ensures that the format adheres to the specified grammar. Resolves: python-poetry/poetry#2326
Prior to this fix, when formatting PEP 508 dependency specification for remote url references, the quoted marker was not prefixed with required whitespace. This change ensures that the format adheres to the specified grammar. Resolves: #2326
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. |
-vvv
option).Issue
When I run:
The following exception is thrown:
If I try to add the package manually to the
pyproject.toml
file as follows:The following exception is thrown instead:
Ref huggingface/transformers#3982
The text was updated successfully, but these errors were encountered: