-
Notifications
You must be signed in to change notification settings - Fork 4
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
simpler directory structure for python/resources #402
Comments
How about moving resources and e2e folders to the same level as src and test?
Just thinking e2e and resources are not exactly source code... |
a few notes after our chat this morning:
i think today the main difficulty here is the non-standards around configuring the layout of your project. PEP 621 helped make the |
ok, not strongly opposed, but I would still separate resources folder in my own projects at the root level. It is a bit inconsistent, but if I had test resources, I would put them in the test folder. I don't need such test resources, so not a compromise in practice for me. I don't like |
i think this has been my struggle the entire time. i think of resources as "not a python package" but the python ecosystem very much does not. so after this restructure, the answer to "is this a package?" is always yes; and some packages contain resources. this issue sets the convention that all packages only contain either python files or resources, and all packages that are for resources will end in
since
the python community puts |
Ok, I don't usually require resources, but if they are part of packages and the community puts them alongside python modules, I am fine with that. We can follow the convention you propose in rats, but I am not too keen on extending this convention to other projects, if there is no consensus in the community. But thanks for explaining all of this, and documenting the inconsistencies between setting up the dev environment and packaging... |
trying to find a structure with fewer directories and the ability to package resources into released wheels. this is what i'm currently finding pleasant along with some naming conventions for certain types of python packages.
src/rats/…
for standard rats python import packages belonging to therats.*
namespace package. this is what we have now but without the additional subfoldersrc/python
.src/rats_resources/
as a new namespace package that is meant to only hold non-python files. i follow the same naming conventions assrc/rats
where there is a sub-package per domain; but files inside each domain follow the naming conventions of standard resources which uses dashes instead of underscores.src/rats_e2e
also follows the structure ofsrc/rats
and contains the end-to-end or integration tests of the component. these are shipped with the wheel unlike the things intest/
specifically because they are meant to be runnable without testing framework. these should run on final artifacts before publishing instead of being run in a development environment.test/*
matches the new directory structure above without the_e2e
package. unit tests and lightweight integration tests meant to be run on a development environment install that includes tools likepytest
.this doesn't stop us from using any other
rats_*
prefix to packages but it's starting to show a convention withrats_e2e
(new),rats_resources
(new), andrats_test
(existing) where we group things at the top level before giving people short and descriptive import names below the top level.Example:
src/rats/apps
has libraries for creating applicationssrc/rats_e2e/apps
has some example apps and other runnable code to ensurerats.apps
is well integratedsrc/rats_resources/apps/some-asset.txt
has some information used by therats.apps
librariestest/rats_test/apps
has the unit tests for the public facing api ofrats.apps
The text was updated successfully, but these errors were encountered: