rye
rye copied to clipboard
Supporting `.pypirc` in publish command
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 https://github.com/astral-sh/rye/issues/759#issuecomment-1963112728
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.
Thanks @cnpryer for pointing this out.
Originally posted by @camilo-s in https://github.com/astral-sh/rye/issues/759#issuecomment-2037687739
Any chance that Twine's
--config-file
option could be dispatched as well? In my current use-case, this would support theTwineAuthenticate@1
task from Azure Pipelines
@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.