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

Export type information #979

Closed
hawkaa opened this issue Aug 9, 2020 · 9 comments · Fixed by #1798
Closed

Export type information #979

hawkaa opened this issue Aug 9, 2020 · 9 comments · Fixed by #1798

Comments

@hawkaa
Copy link
Contributor

hawkaa commented Aug 9, 2020

Is your feature request related to a problem?
Kinda. I'm trying to use the opentelemetry-sdk in my mypy enabled project and get the following error message:

uogc/trace.py:1: error: Skipping analyzing 'opentelemetry.sdk.trace': found module but no type hints or library stubs

Describe the solution you'd like
I see that several packages in this repository is using types. However, these types are not published. Publishing the types is actually not that tricky. We just did it for another project, where the dialogue and code changes are referred to in this PR:

developmentseed/geojson-pydantic#5

In addition, the PyPi "Typing :: Typed" tag should probably be included. See https://github.com/hawkaa/pygeojson/blob/master/pyproject.toml#L14 .

Describe alternatives you've considered
I did think about distributing a separate stub library, but all the types are actually available in the original code. Publishing the type information should be an easy change.

Additional context
I don't know how many packages in this repository that actually has type information, and whether it is going to much work to change the workflow in this repository to add the py.typed file and do some changes in the package info.

Let me know what you think and if you have any questions!

@aabmass
Copy link
Member

aabmass commented Aug 11, 2020

A lot (most?) of the code in opentelemetry-sdk doesn't have type annotations, and we aren't running mypy on the SDK code atm. Issue for that here #773.

All of the annotations in opentelemetry-api should be working (anything not under opentelemetry.sdk).

@hawkaa
Copy link
Contributor Author

hawkaa commented Aug 12, 2020

Ah right. I didn't check properly, then. I checked a file or two in the sdk and they seemed to have type annotations, so I concluded most of it had. I'm sorry.

Type information for the SDK would still be handy, either exporting types directly or creating stubs. What do you think? Should we open a ticket for that, and/or retrofit this one? Or does #773 include exporting the types as well?

Let me know what you think!

@aabmass
Copy link
Member

aabmass commented Aug 12, 2020

@hawkaa no worries! I didn't know about that classifier, it would good to add that. AFAIK the inline types should just work for you as long as we have py.typed files. We can retrofit this issue to track that.

@github-actions
Copy link

github-actions bot commented Apr 9, 2021

This issue was marked stale due to lack of activity. It will be closed in 30 days.

@hawkaa
Copy link
Contributor Author

hawkaa commented Apr 9, 2021

Looks like they are added now, @aabmass ? :)

@github-actions github-actions bot removed the backlog label Apr 10, 2021
@aabmass
Copy link
Member

aabmass commented Apr 15, 2021

Looks like Owais took care of the py.typed files in #1720

But we do not have the Typing :: Typed classifiers still. Do you think we should still add that @hawkaa ?

@hawkaa
Copy link
Contributor Author

hawkaa commented Apr 19, 2021

yes! I'm not sure if there is any practical difference, but I don't see why we shouldn't. Do you want me to try to open a PR to do it?

@flaeppe
Copy link

flaeppe commented Feb 2, 2023

Are there any plans on packaging the type information as well? i.e. PEP 561 (include py.typed as package data)

@ettelr
Copy link

ettelr commented Jan 4, 2024

Any update on PEP 561 support?

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 a pull request may close this issue.

4 participants