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

PyPI support #3

Closed
deajan opened this issue Jan 22, 2023 · 11 comments
Closed

PyPI support #3

deajan opened this issue Jan 22, 2023 · 11 comments

Comments

@deajan
Copy link

deajan commented Jan 22, 2023

Hello,

I'm currently using your i18n fork as base for one of my programs.
I'm trying to add the git dependency in my requirements.txt file, but I cannot get that to work:

requirements.txt:

command_runner>=1.4.1
cryptidy>=1.1.0
python-dateutil
ofunctions.logger_utils>=2.3.0
ofunctions.misc>=1.5.2
ofunctions.process>=1.3.0
ofunctions.threading>=2.0.0
python-pidfile>=3.0.0
pysimplegui>=4.6.0
requests
ruamel.yaml
psutil
git+https://github.com/Krutyi-4el/python-i18n/archive/master.zip

When I run pip install -r requirements.txt, I get the following:

Collecting git+https://github.com/Krutyi-4el/python-i18n/archive/master.zip (from -r requirements.txt (line 13))
  Cloning https://github.com/Krutyi-4el/python-i18n/archive/master.zip to c:\users\orsiris\appdata\local\temp\pip-req-build-1ax6s006
  Running command git clone --filter=blob:none --quiet https://github.com/Krutyi-4el/python-i18n/archive/master.zip 'C:\Users\Orsiris\AppData\Local\Temp\pip-req-build-1ax6s006'
  remote: Not Found
  fatal: repository 'https://github.com/Krutyi-4el/python-i18n/archive/master.zip/' not found
  error: subprocess-exited-with-error

  × git clone --filter=blob:none --quiet https://github.com/Krutyi-4el/python-i18n/archive/master.zip 'C:\Users\Orsiris\AppData\Local\Temp\pip-req-build-1ax6s006' did not run successfully.
  │ exit code: 128
  ╰─> See above for output.

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× git clone --filter=blob:none --quiet https://github.com/Krutyi-4el/python-i18n/archive/master.zip 'C:\Users\Orsiris\AppData\Local\Temp\pip-req-build-1ax6s006' did not run successfully.
│ exit code: 128
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

I've also tried URL https://github.com/Krutyi-4el/python-i18n/archive/refs/heads/master.zip which gives the same results.

Since the original python-i18n isn't developped anymore, would you mind to make a git and PyPI release ?

As a side question, since you don't own the python-i18n namespace on PyPI, would you consider asking @danhper to take owernship of the package, so a new release can be done in the original namespace ?

Best regards.
PS: Thanks for the efforts you put into the project

@solaluset
Copy link
Owner

Hi

You're messing the ways of installing from git. Either of these two lines should work:
https://github.com/Krutyi-4el/python-i18n/archive/master.zip (without the git+!)

git+https://github.com/Krutyi-4el/python-i18n

I wasn't planning on publishing the package. It may be a good idea in the future, though.

@deajan
Copy link
Author

deajan commented Mar 2, 2023

Indeed, I wasn't using the requirements file correctly.
Thanks for your help.

@deajan
Copy link
Author

deajan commented Mar 2, 2023

Mind creating a tag meanwhile ?

@deajan
Copy link
Author

deajan commented Mar 8, 2023

Just for the sake of sanity, using https://github.com/Krutyi-4el/python-i18n/archive/master.zip in requirements.txtwill end up with pkg_resources.extern.packaging.requirements.InvalidRequirement: Parse error at "'+https:/'": Expected string_end error.
The same applies when using the git+ form.

The syntax in requirements.txt needs to be:

python-i18n@https://github.com/Krutyi-4el/python-i18n/archive/master.zip

But then pypi package uploads will fail.
Unless you publish your package, one cannot use it in a requirements.txt file for both pypi and local setups.

@solaluset
Copy link
Owner

Looks like bizarre issue for me. However, I've never worked with PyPi.

@solaluset
Copy link
Owner

Btw, have you tried using commit hash or tag instead of branch name? Maybe PyPI doesn't allow branches to ensure dependency locking.

@deajan
Copy link
Author

deajan commented Mar 9, 2023

Actually, it ends up with the following error message when trying to upload to PyPI

WARNING  Error during upload. Retry with the --verbose option for more details.
ERROR    HTTPError: 400 Bad Request from https://test.pypi.org/legacy/
         Invalid value for requires_dist. Error: Can't have direct dependency: 'python-i18n @ https://github.com/Krutyi-4el/python-i18n/archive/master.zip'

I've also tried following syntax as per PEP-0440 in requirements.txt:

python-i18n @ git+https://github.com/Krutyi-4el/python-i18n.git@0.6.0#8999a0d380be8a08beed785e46fbb31dfc03c605

Ends up the same. Reading PEP-0440, it states

Public index servers SHOULD NOT allow the use of direct references in uploaded distributions. Direct references are intended as a tool for software integrators rather than publishers.

It seems that twine just doesn't allow uploading packages to PyPI with direct references

I'm stuck for now. I only can directly bundle your python-i18n package directly into my app as workaround unless you can publish something on PyPI, even a python-i18n-v2 or so package.

@solaluset
Copy link
Owner

Hm, I see. I can also suggest another workaround: try adding my repository as a git submodule.

@deajan
Copy link
Author

deajan commented Mar 11, 2023

Yeah... But multiplying different dependencies system doesn't seem healthy to me.
Any chance you're making a PyPI release ?

deajan added a commit to netinvent/npbackup that referenced this issue Mar 13, 2023
@solaluset
Copy link
Owner

Published as i18nice 🎉

deajan added a commit to netinvent/npbackup that referenced this issue Mar 27, 2023
@deajan
Copy link
Author

deajan commented Mar 27, 2023

Thank you for the time and effort you put into this ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants