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

Allow pyproject.toml to be located in root dir's parents #21

Merged
merged 1 commit into from
Mar 19, 2019

Conversation

michael-k
Copy link
Contributor

In our projects the root_dir is where django's manage.py lives, but pyproject.toml lives in root_dir.parent.

@andreoliwa andreoliwa added the enhancement New feature or request label Mar 19, 2019
@andreoliwa
Copy link
Owner

Hi @michael-k, thanks for the pull request.

Is your project structure like this?

~/my-django-project/
├── src
│   └── manage.py
└── pyproject.toml

Just understanding the case, so a specific test can be written later.

@michael-k
Copy link
Contributor Author

Yeah, but src is also named my-django-project.

@andreoliwa andreoliwa merged commit d3c4d74 into andreoliwa:master Mar 19, 2019
@andreoliwa
Copy link
Owner

Thanks again, I will release a new version in the coming days.

@andreoliwa
Copy link
Owner

andreoliwa commented Mar 20, 2019

Hi @michael-k.
I'm adding a late test, but things don't seem to be working.
In which of the directories above do you keep your setup.cfg file?

a. together with pyproject.toml?
or
b. together with manage.py?

@michael-k michael-k deleted the pyproject-location branch March 20, 2019 09:47
@michael-k
Copy link
Contributor Author

michael-k commented Mar 20, 2019

We don't have a setup.cfg or setup.py file.

I'll try to look into it later today. Maybe I can provide a minimal example.

@michael-k
Copy link
Contributor Author

I can confirm that it did not work with my change, but works with yours. :)

@andreoliwa
Copy link
Owner

Nice. :)
The test revealed the problem.

I assumed answer "a", setup.cfg in the same dir as pyproject.toml.

Is this a common Django project structure (manage.py inside a dir), or is it specific for your projects?
I tried to write in a generic way.

@michael-k
Copy link
Contributor Author

michael-k commented Mar 21, 2019

django-admin startproject mysite creates the following structure:

mysite/  # could also be renamed to src
    manage.py
    mysite/
        __init__.py
        settings.py
        urls.py
        wsgi.py

I'm not sure if it's best practice to put pyproject.toml in same directory as manage.py or not. I'm not aware of any other django project that uses a pyproject.toml (we only started using it when we introduced black and nitpick is second tool we use it for).

andreoliwa pushed a commit that referenced this pull request Mar 31, 2019
# [0.11.0](v0.10.3...v0.11.0) (2019-03-31)

### Features

* allow pyproject.toml to be located in root dir's parents (thanks [@michael-k](https://github.com/michael-k)) ([#21](#21)) ([d3c4d74](d3c4d74))
@andreoliwa
Copy link
Owner

🎉 This PR is included in version 0.11.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@andreoliwa andreoliwa added the released Feature/fix is released label Mar 31, 2019
@andreoliwa
Copy link
Owner

I'm not sure if it's best practice to put pyproject.toml in same directory as manage.py or not. I'm not aware of any other django project that uses a pyproject.toml (we only started using it when we introduced black and nitpick is second tool we use it for).

I'm also not sure about Django best practices.
I will leave the structure like this, and I can improve it later if someone uses it in a different way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request released Feature/fix is released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants