-
Notifications
You must be signed in to change notification settings - Fork 308
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 "check" command #395
Add "check" command #395
Conversation
This test was fine as-is, but the `future` module that is a subdependency of `readme_renderer` provides a `builtins` that lacks the `__import__` attribute, causing this test to fail when the dependency is added. Instead, simplify the check for the keyring module, and the test as well.
This mostly LGTM, but I'm a little concerned about adding a dependency on readme_renderer since it pulls in a c dependency. Are we at all concerned about systems/environments where that won't work? Or do we feel comfortable with it since this is a developer tool? |
The built distribution support for |
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.
LGTM, but I'd also like @sigmavirus24 to take a look.
I would love for this to extend to other metadata as well. 👍 |
Thank you, @di! |
Can we release this? Thank you very much! PS. Never mind saw #554. |
@@ -72,4 +72,4 @@ def dispatch(argv): | |||
|
|||
main = registered_commands[args.command].load() | |||
|
|||
main(args.args) | |||
return main(args.args) |
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.
This is a very breaking change since the CLI now returns 1 (which is the standard code for "failure") on a successful execution.
This was added accidentally in pypa#395 and was missed on review.
* Fix a bad test The assertion on the exception message was never being run * Add failing test for upload In the event that the upload is successful, the return should be something falsey (such as the implicit None) as this value will eventually be used to determine the exit code. * Remove accidental return statement from upload cmd This was added accidentally in #395 and was missed on review. * Update changelog
try: | ||
import keyring | ||
except ImportError: | ||
if 'keyring' not in sys.modules: |
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.
How will 'keyring'
be in sys.modules
before it is imported?
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.
An excellent point...
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.
I will create an issue 😄
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.
No need, I'm already fixing it.
The
twine check
command determines whether a given distributionslong_description
will be properly rendered on PyPI.By checking the metadata after the distribution has been built, this provides a way to check packages that have build-time dependencies that
python setup.py check
won't install (see pypa/readme_renderer#118).This can eventually be extended to check other metadata as well, once this logic is moved out of Warehouse.