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

Supporting .pypirc in publish command #792

Open
cnpryer opened this issue Feb 26, 2024 · 3 comments
Open

Supporting .pypirc in publish command #792

cnpryer opened this issue Feb 26, 2024 · 3 comments

Comments

@cnpryer
Copy link
Contributor

cnpryer commented Feb 26, 2024

Assuming #759 is merged, it'd be nice to add --config-file dispatch to more consciously support .pypirc (I can't remember if Twine will dynamically load this with incomplete arguments).

It might be nice to implement this so that .pypirc can be used in place of Rye's credentials management.

So something like this would tell Rye to disregard managed credentials in favor of the .pypirc file.

rye publish --config-file <path>

And if this pattern works well, we could extend it to support other credentials files.

Originally posted by @cnpryer in #759 (comment)

@cnpryer cnpryer changed the title Supporting pypirc for in publish command Supporting .pypirc for in publish command Feb 26, 2024
@cnpryer cnpryer changed the title Supporting .pypirc for in publish command Supporting .pypirc in publish command Feb 26, 2024
@golgor
Copy link

golgor commented Mar 5, 2024

Just found this crate from Charlie Marsh, it is probably what is needed to parse the .pypirc. I tried a little bit with expecting it to be a .toml and that didn't work out at all. I'm pretty sure a .INI-style is used.

https://github.com/charliermarsh/configparser-rs

I just figured I could share this here for future notice.

@camilo-s
Copy link

camilo-s commented Apr 5, 2024

Thanks @cnpryer for pointing this out.

Originally posted by @camilo-s in #759 (comment)

Any chance that Twine's --config-file option could be dispatched as well?
In my current use-case, this would support the TwineAuthenticate@1 task from Azure Pipelines

@golgor
Copy link

golgor commented Apr 5, 2024

@camilo-s just FYI, it is possible to supply them via command line in the current version or Rye. It should be possible to either get this information from Azure or setting it up locally on your machine and look at your local .pypirc. Everything is stored in clear text so it is just copy/pasting.

I.e. you wouldn't have to run the task TwineAuthenticated-task at all. I have this in my Github Action when publishing to a private repo on Google Cloud:

rye publish -r ${{ env.REPO_NAME }} --repository-url ${{ env.REPO_URL }} --username ${{ env.USERNAME }} --token ${{ env.PASSWORD }} -y

And that works great for me.

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

3 participants