3 ms·
One of the things that I've seen bother people is that the source code ends up in a directory named PROJNAME/PROJNAME. Once you understand how the module syste
by rdw 14y ago
One of the things that I've seen bother people is that the source code ends up in a directory named PROJNAME/PROJNAME. Once you understand how the module system works in Python, it makes sense that things are this way, but it can be kind of a redundancy shock.
- llambda 14y agoIt's important to realize that the outermost dir is not generally the dir containing the package. In other words, the outermost dir is usually the dir that contains the project files, which also includes the package dir itself. So for instance you might have some necessary build utilities, such as setup.py, a README, perhaps some tests, as well as a dir containing the actual package. Thought of like this, there's no actual redundancy, but it definitely is confusing until you make that connection. Here's a simple example: project/ README setup.py test_project.py project/ __init__.py project.py Here project/project/ is the actual package, everything above that dir is simply ancillary to the actual package itself.
- webjunkie 14y agoFor Django I like to do django-useful-app/ setup.py ... useful_app/ __init.py ..
- Aethaeryn 14y agoGithub can make it seem even more redundant if you have an organization with the same name as your repository. For instance, django is essentially django/django/django when you think about the structure[1]. [1] https://github.com/django/django/tree/master/django https://github.com/django/django/tree/master/django
- tbatterii 14y agoUltimately.... https://github.com/github https://github.com/github
- ineedtosleep 14y agoExperienced this exact thing after the Django 1.4 release, however, it makes sense now and it is not much of a nuisance any longer.