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

Support packages whose name does not match the project name #631

Merged
merged 4 commits into from
Nov 6, 2020

Conversation

oncleben31
Copy link
Contributor

if the package name and project name are not similar (more than - replaced by _), a package key will be added in pyproject.toml file.

Example:

packages = [
    { include = "package_name", from = "src" },
]

fix: #546

if package name and project name are not similar ('-' replaced by '_'),
a 'package' key will be added in pyproject.toml file.
@oncleben31
Copy link
Contributor Author

I didn't see any part in documentation that should be update according to this modification of pyproject.toml

@oncleben31
Copy link
Contributor Author

Failure of tests-3.9 with windows seems not related to my modifications.

@cjolowicz cjolowicz added the enhancement New feature or request label Oct 31, 2020
@cjolowicz cjolowicz added this to the 2020.11.15 milestone Oct 31, 2020
Copy link
Owner

@cjolowicz cjolowicz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, thank you for the contribution! There is an issue related to whitespace handling in Jinja, otherwise looks perfect to me. See the inline comment.

{{cookiecutter.project_name}}/pyproject.toml Outdated Show resolved Hide resolved
Co-authored-by: Claudio Jolowicz <cjolowicz@gmail.com>
@oncleben31
Copy link
Contributor Author

White space handling corrected. With this version we have a line break between documentation and classifiers keys when no packages key is needed. Is it OK for you ?

Co-authored-by: Claudio Jolowicz <cjolowicz@gmail.com>
@cjolowicz cjolowicz changed the title Add 'package' key in pyproject.toml when necessary Support packages whose name does not match the project name Nov 6, 2020
@cjolowicz cjolowicz merged commit 3344bf4 into cjolowicz:master Nov 6, 2020
@cjolowicz
Copy link
Owner

Woot 🎉

@oncleben31
Copy link
Contributor Author

Do you think we should add a test case in CI ?

@oncleben31 oncleben31 deleted the issue546 branch November 6, 2020 10:02
@cjolowicz
Copy link
Owner

Yes, but I would not add this to the CI workflow. This should be in a test suite run by pytest, see #616. Unfortunately, we don't have this infrastructure yet. But it's overdue, so if you want to start work on that, that's more than welcome. It's a bunch of work, though.

@cjolowicz cjolowicz mentioned this pull request Nov 14, 2020
paw-lu pushed a commit to paw-lu/cookiecutter-hypermodern-python that referenced this pull request Mar 8, 2021
…z#631)

* Add test to specify package name when necessary

if package name and project name are not similar ('-' replaced by '_'),
a 'package' key will be added in pyproject.toml file.

* Avoid blank line

* whitespace handling correction

* Remove useless line break
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Query/Bug] project_name and package_name dependencies
2 participants