pypa / setuptools-scm

the blessed package to manage your versions by scm tags
https://setuptools-scm.readthedocs.io/en/latest/
MIT License
864 stars 212 forks source link

Request: adding type hints and py.typed to setuptools_scm #501

Open jamesbraza opened 3 years ago

jamesbraza commented 3 years ago

As I am sure the setuptools_scm maintainers are aware:

I use setuptools_scm as part of some type checked code (via mypy). From what I have seen, setuptools_scm:

There is a similar ticket for setuptools: https://github.com/pypa/setuptools/issues/2345

Any thoughts on adding support for type hints?

Aside: I'm not sure how one can add type hints and maintain support for Python 2.7 and 3.4.


Workaround

In the meantime, I am adding the following to my setup.cfg section for mypy:

[mypy-setuptools_scm.*]
ignore_missing_imports = True
RonnyPfannschmidt commented 3 years ago

Im happy to add typing after python 2.7 is dropped

Python 2.7 will be dropped when pip does

tuukkamustonen commented 3 years ago

Pip 21.0 dropped py2 support. This can be now done! 🥳

RonnyPfannschmidt commented 3 years ago

python 2 support was dropped in version 6 of setuptools_scm

RonnyPfannschmidt commented 2 years ago

i started adding some type hints, its still along way till py.typed tho

ssbarnea commented 1 year ago

@RonnyPfannschmidt Any chance to resume on that? Even partial types could help, we don't need 100% from start.

RonnyPfannschmidt commented 1 year ago

There are some needed breaking changes after which it makes sense,

Im currently a bit stretched

RonnyPfannschmidt commented 1 year ago

type annotations are added, the 8.x series will not export them yet

jamesbraza commented 1 year ago

More out of curiosity, why add type annotations and then not export them? Is it just to test out type annotations for some time?

RonnyPfannschmidt commented 1 year ago

As soon as they are exported,the number of actions one can take for refactoring that count as breaking change increase

The typing closure for the configuration,scm versions and version schemes is currently very fuzzy and locking it in for externals would be a major paint

jamesbraza commented 1 year ago

Oh that makes sense, thank you for circling back! Appreciate the quick response too

RonnyPfannschmidt commented 1 year ago

That being said, i Wish I wasn't quite as stretched so I could complete the work on this timely

kasium commented 7 months ago

Just my 2 cent on this: As long as the API is stable, IMO it's fine if the type annotations change in an incompatible way. You could even see type annotation changes as fixes since the type annotation is then better as before and maybe even more correct 😄

RonnyPfannschmidt commented 7 months ago

as im rather stretched in delivering certain refactorings i am hesitant to impose possile type anotation enforced breakage on downstreams, not that there arent many of them