Skip to content

Conversation

@tekktrik
Copy link
Member

Library name used underscore instead of hyphen

Library name used underscore instead of hyphen
@tekktrik tekktrik requested a review from a team February 18, 2022 19:35
Copy link
Contributor

@FoamyGuy FoamyGuy left a comment

Choose a reason for hiding this comment

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

it's listed in setup.py with an underscore:

name="adafruit-circuitpython-bitmap_font",

and pip3 install adafruit-circuitpython-bitmap_font seems to work for installing from pip.

Is there a reason the hyphen is preferred?

@tekktrik
Copy link
Member Author

tekktrik commented Feb 18, 2022

Oh weird, no, to be completely honest I only ran into while digging into another issue. It really stemmed from how PyPI says to install it:

Capture

But if it works otherwise then nevermind!

@tekktrik tekktrik closed this Feb 18, 2022
@FoamyGuy
Copy link
Contributor

Interesting, never noticed that before. It installs correctly with the hyphenated name too. So it seems pip or PyPi silently converts between the two.

I found some related discussion here: ros/rosdistro#18116 which points to a PEP that mentions using underscores is "discouraged": https://www.python.org/dev/peps/pep-0008/#package-and-module-names
image

It's unclear why it's discouraged but it might be good in the long run for us to move anything that does use underscores to hyphens. If we do that we'll need to make sure there are no adverse consequences for the CI task that publishes to PyPi (i.e. make sure changing the name in setup.py won't freak it out or create a duplicate listing or anything).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants