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

Option to enable uppercase letters in package names #4326

Closed
2 tasks done
mdaeron opened this issue Jul 29, 2021 · 2 comments
Closed
2 tasks done

Option to enable uppercase letters in package names #4326

mdaeron opened this issue Jul 29, 2021 · 2 comments
Labels
status/duplicate Duplicate issues

Comments

@mdaeron
Copy link

mdaeron commented Jul 29, 2021

  • I have searched the issues of this repo and believe that this is not a duplicate.
  • I have searched the documentation and believe that my question is not covered.

Feature Request

TL;DR: I would like to ask about supporting capitalized package names.

In light of PEP 8, I understand the design choice to convert package name to lowercase when publishing to PyPI. I am aware that it is possible to kind-of-override this behavior by using something like packages = [{include = "myPackage"}] in pyproject.toml, as pointed out in #1538.

Working example

I just tested this for an upcoming package named D47calib (see further down for why the D should be uppercase):

  1. I first created and published D47calib v0.0.1 using twine, which resulted in a PyPI project page named D47calib.
  2. I then made some minor edit, changed version to 0.0.2, and published it with flit, which preserved the PyPI project name (still D47calib).
  3. Finally, I made new minor edits, changed version to 0.0.3, re-created pyproject.toml with poetry (v1.1.7), with packages = [{include = "D47calib"}] as suggested above, and published that with poetry.

The last step, surprisingly, changed the PyPI project name to d47calib (with lowercase d). In spite of this, both pip install D47calib and import D47calib still work as before.

Why enable non-PEP-8-compliant names in some cases?

For context: I am the author of the D47crunch package used by geochemists, and I am looking to switch to poetry from flit. There are two strong reasons I will not change the package name at this point:

  1. Asking users to switch to a new name is going to be a mess;
  2. Semantically, in geochemistry there is a critical difference between d47 and D47, so in this case the uppercase D is part of the message.

I am a big fan of style guidelines, both for code and for writing in general, but I also believe it's important to know how/when to deviate from the default style. It would be great if poetry offered a simple way to force preservation of the original capitalization, perhaps with a strongly worded warning pointing to PEP 8. If this is simply not technically possible and/or unacceptable on philosophical grounds, authors of existing capitalized packages will have to do without poetry, which would suck.

At this point, it seems that the remaining issues are with build and publish. I've tried manually editing the sdist and wheel files (replacing all occurrences of d47 by D47 and providing new hash values), but this was not enough to restore proper capitalization in PyPI.

Thanks for hearing me out and for the great work you've done so far.

@mdaeron mdaeron added kind/feature Feature requests/implementations status/triage This issue needs to be triaged labels Jul 29, 2021
@neersighted neersighted added status/duplicate Duplicate issues and removed kind/feature Feature requests/implementations status/triage This issue needs to be triaged labels Oct 11, 2022
@neersighted
Copy link
Member

Duplicate #1202.

@neersighted neersighted closed this as not planned Won't fix, can't repro, duplicate, stale Oct 11, 2022
Copy link

github-actions bot commented Mar 1, 2024

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status/duplicate Duplicate issues
Projects
None yet
Development

No branches or pull requests

2 participants