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

stubs package with data_files #4844

Merged
merged 1 commit into from
Jun 2, 2021
Merged

Conversation

FoamyGuy
Copy link
Collaborator

@FoamyGuy FoamyGuy commented Jun 2, 2021

With package_data and packages the installed files end up like:

/[Python]/lib/site-packages/circuitpython-stubs/digitalio
/[Python]/lib/site-packages/circuitpython-stubs/displayio
/[Python]/lib/site-packages/circuitpython-stubs/...

when it is like this the IDE will not recognize the stubs unless they are imported like this:

from circuitpython import digitalio

To fix we can use data_files to install all of the circuitpython stubs into the root of ../site-packages/

This allows the IDE to recognize the stubs when used as normal in circuitpython code i.e.

import digitalio

I tried some other ways of installing multiple packages instead of using data_files but never found a working solution, perhaps there are some though.

I tested the stubs from this technique successfully with PyCharm, but not with this repo specifically. I was able to get local pip install and pip install from a test pypi listing to work correctly.

@tannewt tannewt self-requested a review June 2, 2021 15:28
Copy link
Member

@tannewt tannewt 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! Do we have auto-release set up already?

@tannewt tannewt merged commit 850ede7 into adafruit:main Jun 2, 2021
@FoamyGuy
Copy link
Collaborator Author

FoamyGuy commented Jun 2, 2021

I don't think it is currently set up. There is a circuitpython-stubs listing on PyPi so perhaps it was at one point but doesn't seem to be actively running still.

In the libraries there is a workflow in the release.yml actions file that uses twine to upload to pypi. Only glanced through the actions files in this repo but didn't any pypi related actions in them.

Do we want to use essentially the same release action from the libraries? if so I can PR that, or if there is a different way that is needed I'd be happy to give it a try, but may need further direction.

@tannewt
Copy link
Member

tannewt commented Jun 3, 2021

Do we want to use essentially the same release action from the libraries? if so I can PR that, or if there is a different way that is needed I'd be happy to give it a try, but may need further direction.

Ya, I think so. I think the existing releases were manually done. Following the library approach is a good idea.

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.

None yet

2 participants