-
Notifications
You must be signed in to change notification settings - Fork 131
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
Add custom pypirc support #434
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks - this is mostly OK, but needs a few adjustments.
This patch removes the default value from the pypirc argument so None can be used as a sentinel value. In case the provided value does not exist an error is raised. Otherwise, if no value is provided "~/.pypirc" is used as default.
temp_file.close() | ||
yield temp_file.name | ||
finally: | ||
os.unlink(temp_file.name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pytest has a handy shortcut for this - if you use a tmp_path
fixture in a test, it creates a temporary directory, you can write whatever you want there, and it will all be cleaned up when the test runs. Docs here
I'm happy with this, the fixture is just a neat thing to know about. 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Good to learn about that :)
Thanks! |
This PR adds support for handling a custom path for the
.pypirc
file. Previously the file was assumed to always be in~/.pypirc
, which can be an issue depending on the build environment that is being used as stated in #426.The path can be passed through the
--pypirc
argument, as such:A unit test was added to ensure the parsing is correctly done when the custom path is specified.