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

PEP 561 compliance #17

Merged
merged 2 commits into from Oct 11, 2020
Merged

Conversation

tomwatson1024
Copy link
Contributor

@tomwatson1024 tomwatson1024 commented Oct 2, 2020

Add type hints and a 'py.typed' marker file (see PEP 561) to allow type checking in dependent code.

I've not added any automatic type checking or anything - I have run mypy over the code to confirm that my type hints are correct, though.

Not sure if this qualifies for a news fragment - happy to write one if necessary.

@codecov
Copy link

codecov bot commented Oct 2, 2020

Codecov Report

Merging #17 into master will not change coverage.
The diff coverage is 100.00%.

@@            Coverage Diff            @@
##            master       #17   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            4         4           
  Lines           72        73    +1     
  Branches         6         6           
=========================================
+ Hits            72        73    +1     
Impacted Files Coverage Δ
sniffio/_impl.py 100.00% <100.00%> (ø)

Copy link
Contributor

@sethmlarson sethmlarson left a comment

Choose a reason for hiding this comment

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

Thanks for this! Two general comments:

  • I believe there's an extra step you need to do to make sure py.typed shows up in our dists, maybe add to MANIFEST.in?
  • Within ci/travis.sh can you add a step in CHECK_FORMATTING that runs mypy on the file?

And I don't think a newsfragment is necessary, this project doesn't require a ton of updates to be coordinated :)

sniffio/_impl.py Show resolved Hide resolved
@tomwatson1024
Copy link
Contributor Author

* I believe there's an extra step you need to do to make sure `py.typed` shows up in our dists, maybe add to `MANIFEST.in`?

Ah yes, of course - I've gotten used to Poetry, which just automagically makes this kind of thing work!

* Within `ci/travis.sh` can you add a step in `CHECK_FORMATTING` that runs mypy on the file?

Can do.

@sethmlarson sethmlarson merged commit 7aabf2e into python-trio:master Oct 11, 2020
@trio-bot
Copy link

trio-bot bot commented Oct 11, 2020

Hey @tomwatson1024, it looks like that was the first time we merged one of your PRs! Thanks so much! 🎉 🎂

If you want to keep contributing, we'd love to have you. So, I just sent you an invitation to join the python-trio organization on Github! If you accept, then here's what will happen:

  • Github will automatically subscribe you to notifications on all our repositories. (But you can unsubscribe again if you don't want the spam.)

  • You'll be able to help us manage issues (add labels, close them, etc.)

  • You'll be able to review and merge other people's pull requests

  • You'll get a [member] badge next to your name when participating in the Trio repos, and you'll have the option of adding your name to our member's page and putting our icon on your Github profile (details)

If you want to read more, here's the relevant section in our contributing guide.

Alternatively, you're free to decline or ignore the invitation. You'll still be able to contribute as much or as little as you like, and I won't hassle you about joining again. But if you ever change your mind, just let us know and we'll send another invitation. We'd love to have you, but more importantly we want you to do whatever's best for you.

If you have any questions, well... I am just a humble Python script, so I probably can't help. But please do post a comment here, or in our chat, or on our forum, whatever's easiest, and someone will help you out!

@sethmlarson
Copy link
Contributor

Thanks for these changes! Will prepare a 1.2.0 release :)

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