Skip to content
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

Django extension not migrated to the src layout #196

Closed
abravalheri opened this issue Aug 13, 2018 · 5 comments
Closed

Django extension not migrated to the src layout #196

abravalheri opened this issue Aug 13, 2018 · 5 comments
Labels
bug Something isn't working
Milestone

Comments

@abravalheri
Copy link
Collaborator

When creating a django project using PyScaffold, the created folder structure doesn't follow PyScaffold 3.* src layout.

Steps to reproduce:

  • With PyScaffold > 3.0, do:
$ putup myproj --django
  • Check the generated file structure:
$ tree myproj
myproj
    ├── AUTHORS.rst
    ├── CHANGELOG.rst
    ├── docs
    │   ├── authors.rst
    │   ├── changelog.rst
    │   ├── conf.py
    │   ├── index.rst
    │   ├── license.rst
    │   ├── Makefile
    │   └── _static
    ├── LICENSE.txt
    ├── manage.py
  **├── myproj**
    │   ├── __init__.py
    │   ├── settings.py
    │   ├── urls.py
    │   └── wsgi.py
    ├── README.rst
    ├── requirements.txt
    ├── setup.cfg
    ├── setup.py
    ├── src
  **│   └── myproj**
    │       ├── __init__.py
    │       └── skeleton.py
    └── tests
        ├── conftest.py
        └── test_skeleton.py

    6 directories, 22 files
@abravalheri
Copy link
Collaborator Author

Is this the expected behavior?
If that is the case, maybe we should add this exception to the documentation...

@FlorianWilhelm
Copy link
Member

This looks seems to be rather a bug actually. The files of django-admin should reside in src/myproj.

@abravalheri
Copy link
Collaborator Author

abravalheri commented Aug 13, 2018

This is also happening to cookiecutter :(

putup myproj --cookiecutter cookiecutter-pypackage.git

(It is probably happening since 3.0, but I just noticed now)

@FlorianWilhelm
Copy link
Member

I can confirm that at least for Django the problem was already in version 3.0.3. Do you know of any simple way to fix this? Maybe we need to chdir into src before we run the django command? I think for cookiecutter it's even more problematic. Here we need to change our test cookiecutter repo and also transform it into a src-layout. We will not be able to check if a cookiecutter template follows the src-layout or if it doesn't, thus we should just apply it and tell in the docs that the template should have the src-layout. For Django it's a different story, here it would be nice to somehow assert that the files are created within src/{package}.

@FlorianWilhelm
Copy link
Member

I forked the cookiecutter template that we use into our PyScaffold organization so that we can refer to this one in our unit tests instead of https://github.com/FlorianWilhelm/cookiecutter-pypackage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants