-
-
Notifications
You must be signed in to change notification settings - Fork 313
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
Error: API Token or Trusted Publisher must be used to upload in place of password #1013
Comments
Set the username to |
Hi @ofek, I've also tried Thanks for your help! |
You are entering the token into the user field it appears |
Yes, Hatch uses your system's credential manager to store previous authentication info and that might require you entering your password. Did the upload work after that? |
ahh, now I got the solution! Maybe this info can be added to https://hatch.pypa.io/latest/publish/#authentication |
Follow-up question: |
Use the flags of the publish command to set both the username and authentication info. The |
|
I've now tried to use a few flags of the publish command to set both the username and authentication info, but that all did not work:
-> ❌
-> ❌
-> ❌ any further ideas how I can update the pypi token? Any suggestions are much appreciated! |
Let's start from the top. To authenticate you need credentials and your username. Which flags do you think correspond to each one? |
I'm still a bit confused with the flags and their usage. I have tried Thanks again for your support! |
Try both the user and auth flags at the same time |
now I've tried
but non of these worked. |
|
I appreciate your patience! 🌻 Any other ideas? |
Try to make a different token. |
I just generated a new token and tried that, but did not work as well. |
Try |
Hey @ofek , thanks for this hint! And I'd like to ask a follow-up question: |
I think it should be saved after it works once, try again? |
Can you please try removing https://hatch.pypa.io/latest/config/hatch/#cache and do it again? |
Well yes but if you fix the username does it work I mean. Try again but this time fix the token variable (sorry about that) |
Could you modify the code of your Hatch installation to add some print statements? |
I must admit that I don't know how that can be done. |
How did you install it? |
|
You can find site-packages relative to the location shown:
|
jan-hendrik@JanHendriksAir ~ % hatch run :python3 -c "import sys;print(sys.executable)"
/opt/homebrew/opt/python@3.11/bin/python3.11
jan-hendrik@JanHendriksAir ~ % cd /opt/homebrew/opt/hatch
jan-hendrik@JanHendriksAir hatch % ls -a
. INSTALL_RECEIPT.json libexec
.. LICENSE.txt share
.DS_Store README.md
.brew bin
jan-hendrik@JanHendriksAir hatch % I got this. |
|
that gives me jan-hendrik@JanHendriksAir ~ % ls /opt/homebrew/opt/python@3.11
Frameworks Python Launcher 3.app libexec
IDLE 3.app README.rst share
INSTALL_RECEIPT.json bin
LICENSE lib
jan-hendrik@JanHendriksAir ~ % ls /opt/homebrew/opt/hatch/bin
hatch
jan-hendrik@JanHendriksAir ~ % /opt/homebrew/opt/python@3.11/bin/python3.11 -m site
sys.path = [
'/Users/jan-hendrik',
'/opt/homebrew/Cellar/python@3.11/3.11.7/Frameworks/Python.framework/Versions/3.11/lib/python311.zip',
'/opt/homebrew/Cellar/python@3.11/3.11.7/Frameworks/Python.framework/Versions/3.11/lib/python3.11',
'/opt/homebrew/Cellar/python@3.11/3.11.7/Frameworks/Python.framework/Versions/3.11/lib/python3.11/lib-dynload',
'/opt/homebrew/lib/python3.11/site-packages',
'/opt/homebrew/Cellar/pybind11/2.11.1/libexec/lib/python3.11/site-packages',
'/Users/jan-hendrik/projects/ipyreact',
'/opt/homebrew/opt/python@3.11/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages',
]
USER_BASE: '/Users/jan-hendrik/Library/Python/3.11' (doesn't exist)
USER_SITE: '/Users/jan-hendrik/Library/Python/3.11/lib/python/site-packages' (doesn't exist)
ENABLE_USER_SITE: True |
Should be a
|
both exists: jan-hendrik@Jan-Hendriks-MacBook-Air ~ % cd /opt/homebrew/lib/python3.11/site-packages/hatchling && ls -a
. __main__.py cli ouroboros.py version
.. bridge dep plugin
__about__.py build.py licenses py.typed
__init__.py builders metadata utils
jan-hendrik@Jan-Hendriks-MacBook-Air hatchling % cd /opt/homebrew/opt/python@3.11/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/hatchling && ls -a
. __main__.py cli ouroboros.py version
.. bridge dep plugin
__about__.py build.py licenses py.typed
__init__.py builders metadata utils |
Look for hatch rather than hatchling. After you find it try to modify code to see what happens (I'm assuming one of those directories is actually a symbolic link to the other) |
I cannot find a hatch folder there:
|
|
|
Recommend Also consider if you can just do |
I've just reset my whole Mac and then re-installed the latest version of hatch, now the problem is gone 🎉 |
A few months ago,
hatch publish
worked fine for me.Now, I get the error:
I've already generated a token on pypi that looks like this
pypi-AgEIdffx*********************************************************
How can I feed this token to hatch, so that I can publish my packages?
I'm grateful for any help!
The text was updated successfully, but these errors were encountered: