-
Notifications
You must be signed in to change notification settings - Fork 14
Convert into a proper package #9
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
Conversation
|
This makes me a little nervous, I sometimes get confused about what happens during imports (don't run tests from your source folder, etc). The idea was to have a single file so you can also copy it into another project without adding a dependency. Organizing other things like examples and future docs into folders makes sense to tidy up, and if the code grows then we should come back to this. |
Right now the package/directory needs to be in your pythonpath. You can't drop it anywhere inside a project, but I could look into using local imports instead to make this possible? That should make the package as flexible as the original module. Usually the location of the executed script will be added to the pythonpath (module/package discovery) or the current working directory will be used then running a module ( If you have a project structure like this: Running it with: .. then the project root (location of If you copy the package/directory inside subdirectories in your project there will of course be import issues. Again, I can see if it's possible to use local imports across py2 and py3 to allow for this. I'm more than willing to help out resolving any concern.
This is not uncommon. The only difference is that you copy a directory instead of a single module. Things should be exactly same as before unless you add new members to any of the submodules (you will have to import them in (Except for the limitations pointed out in the above answer)
I think organizing the package like this will encourage more development/contributors. The code is a lot easier to reason with and understand. It's also structured like the vast majority of python packages and is a lot easier to keep expanding. |
jonwright
left a comment
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.
OK - it does look a lot better. Lets assume the packaging problems of old are now solved. We can get to version number when closer to a release.
|
Awesome 😄 Make sure you have fresh setuptools, wheel and twine before uploading and packaging is a breeze. 👍 Do speak up if you have import issues when copying the package to a project. We can for example modify |
A suggestion splitting the project into a proper package. I think this makes the project a lot more pleasant to work with.
This should not change any behavior compared to the single module because everything that was in
__all__is imported in__init__.py. When there is no supported platform we get the sameImportErroras before.setup.pyis also change to include the new package instead of a single module.demo.py andshader_example.pyworks as before in windows. I have not gotten the chance to test things in linux.