Refactor imports#26
Refactor imports#26
Conversation
Improved compatibility, robustness, clear errors and some cleaning up. Also synced with the readme.
|
@yesbox - I've merged this and it looks good. I've added edits for removing However, this now introduces a bug within Python2 which stops The latter would work and was my primary method of testing code. Do you have an answer to that issue? Note that examples still work as they use the relative CloudFlare library due to |
|
There are a couple of ways, sorted by effort (and payoff). You can have Python run the package as a module: You can make an editable install, this will make the package act as in production but you can edit it live without having the reinstall to test your changes. The --user option installs the package in ~/.local/, but since combined with --editable you would still edit the files in the source, not in ~/.local/: Or my preferred method, virtualenv. Then you have a clean environment that is easy to scratch. If you like this way of working you can look up virtualenvwrapper later to make it more convenient. Because the virtualenv is empty of Python packages installed globally or locally this is the only method with which one would have found the setup.py dependency issue. The install doesn't have to be editable. With any of the two latter methods your example scripts should also function without the "sys.path.insert(0, os.path.abspath('..'))" but that I have not tested. |
This is a refactor of the imports in the CloudFlare library. I was prompted to make these changes when trying to use the cli4 utility with Python 3.5 and it wouldn't run. I have done a quick test with the changes on Python 2.6, 2.7. 3.3, 3.4 and 3.5.
Improved compatibility
Robustness and clear errors
Cleaning up
Documentation and discoverability
Not done (and don't intend to)
I have not changed the test or the examples.