-
Notifications
You must be signed in to change notification settings - Fork 106
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
Reorganize lib to fit distribution conventions. #54
Conversation
I believe you would not need to change the CLI invocation if cmd.py-> |
I will try it and update the PR! |
@martindurant Correct! I renamed |
test_snappy.py
Outdated
@@ -29,7 +29,7 @@ | |||
import os | |||
import sys | |||
import random | |||
import snappy | |||
from snappy import snappy |
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.
Will all users of the new structure need to do this?
Could not the __init__.py
import everything one might need from the module, so that we don't force a code change on users of snappy?
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.
@martindurant short answer is no, the public API is unchanged.
In this case, the tests expect access to internal snappy
variables (_CHUNK_MAX
for example) which didn't make sense to include in the API and import in __init__.py
. My first approach was to import the internal snappy
module so the tests could access those internal variables.
I've updated the PR to import snappy
at the top level and access the hidden variables via snappy.snappy
. Let me know what you think.
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.
That's fine with me, so long as the PR is transparent for users.
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.
Agreed; the current API is preserved, assuming users are not attempting to access private variables.
Anyone with any further comments? |
LGTM! 👍 |
Thank you @kronosapiens for your work! |
My pleasure! Do you know when the new version will be on PyPi? |
Unfortunately, my earlier PR (#53) didn't quite fix the packaging issues.
To solve the problem, I moved the source files into a
snappy
subdirectory and added an__init__.py
to preserve the existing API. The only API change is that command-line invocation requires referencing thesnappy.cmd
module, assnappy
now refers to a package, instead of an individual module.I have tested the new packaging by building and installing form source and wheels, run the test suites, and tested the command-line invocation.