-
Notifications
You must be signed in to change notification settings - Fork 1
Add type hints #6
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
Add type hints #6
Conversation
@tlaferriere Thanks Thomas, much appreciated! 👍 I've adapted the wording a bit and pushed it now to the branch. Anything else that I should integrate? Or are you still working on the typing? |
b8f88f6
to
c94e72a
Compare
* Remove targets py27, py34, py35, and pypy from `tox.ini` * Update `README.rst` and remove anything related to Python2 Mention maintenance branch `maint/v2` * `setup.py` - Update Trove classifiers - Require now Python >=3.6.* - Remove Tox and Clean classes, try to make it as simple as possible - Extract metadata directly from source (affects all the __version__, __author__ etc. variables) * `setup.cfg` - Add pycodestyle section * `semver.py` - Change version number to "3.0.0-alpha0" - Remove old code related to Python2 - Adjust Python2 vs. Python3 str/bytes - Add wheel as another test requirement * `tox.ini` - Remove py27, py34, and py35 (out of maintenance) - Add docs to default testenv - Remove --universal from bdist_wheel * Split test suite into separate files under tests/ dir * Travis: Remove old versions, integrate new - Remove 2.7, 3.4, 3.5, and pypy - Integrate 3.8, 3.9-dev and nightly builds - Allow nightly to fail * Add .editorconfig to have a consistent editor setup Co-authored-by: Thomas Laferriere <t.laferriere@hotmail.ca>
Completely revamp file. Mostly update from gh://github/gitignore/ and integrate: * Python * Global/Kate * Global/Vim * Global/VisualStudio * Global/JetBrains
* Remove Python2 * Use Roboto font family Sans: Roboto (for text) "Serif": Roboto Slab (for headings) Monospace: Roboto Mono (for code) * Improve CSS navigation * Create new logo and move it to docs/_static * Add new section about how to get the version of semver * Use a more general term (2.x.y) instead of specific versions * Number sections * Rework deps for doc build * Rework release procedure
* Add `changelog.d/.gitignore` to keep this directory * Create `changelog.d/README.rst` with some descriptions * Add `changelog.d/_template.rst` as Towncrier template * Add `[tool.towncrier]` section in pyproject.toml * Add "changelog" target into `tox.ini`. Use it like "tox -e changes -- CMD" whereas CMD is a towncrier command. The default "tox -e changes" calls towncrier to create a draft of the changelog file and output it to stdout. * Update documentation and add include a new section "Changelog" included from `changelog.d/README.rst` * Update changelog.d directory and add new files
(cherry picked from commit d9394af)
c94e72a
to
e804eed
Compare
Actually I just wanted your opinion on it. I'm fairly certain that I've typed everything that could be typed, but I wonder if it is just too convoluted in some places ( see the aliases). Also maybe check it for any mistakes. There are also some changes to the Travis file, but I can't really test those locally. Mypy passes btw. |
You might want to consider cherry-picking 10c2173 too, because I changed the types of the changelog files. |
Generally, remove everything related to Python 2.7 & 3.4 and add missing 3.8 & 3.9: * Raise version to 2.99.99 (to indicate that it's different from 2.10.0) * Prepare (empty) CHANGELOG for 2.99.99 * Correct Trove categories and python_requires in setup.py * Adapt tox.ini & .travis.yml: remove old stuff, add missing (see above) * Adapt semver.py - Remove if clause for cmp - Don't check for `__name__`, use `__qualname__` instead - Use yield from ... (for loop is not necessary anymore)
This makes it possible to distinguish between version 2 and version 3. For example, >=2.8,<3
10c2173
to
9808da4
Compare
Add changelog for the type hints issue Make mypy pass and try adding it to travis.yml Run black Remove unnecessary and overly complicated type alias Add beautiful type aliases Configure tox to run mypy check First try for type hints everywhere. It passes mypy in python 3.8
* Remove targets py27, py34, py35, and pypy from `tox.ini` * Update `README.rst` and remove anything related to Python2 Mention maintenance branch `maint/v2` * `setup.py` - Update Trove classifiers - Require now Python >=3.6.* - Remove Tox and Clean classes, try to make it as simple as possible - Extract metadata directly from source (affects all the __version__, __author__ etc. variables) * `setup.cfg` - Add pycodestyle section * `semver.py` - Change version number to "3.0.0-alpha0" - Remove old code related to Python2 - Adjust Python2 vs. Python3 str/bytes - Add wheel as another test requirement * `tox.ini` - Remove py27, py34, and py35 (out of maintenance) - Add docs to default testenv - Remove --universal from bdist_wheel * Split test suite into separate files under tests/ dir * Travis: Remove old versions, integrate new - Remove 2.7, 3.4, 3.5, and pypy - Integrate 3.8, 3.9-dev and nightly builds - Allow nightly to fail * Add .editorconfig to have a consistent editor setup Co-authored-by: Thomas Laferriere <t.laferriere@hotmail.ca>
* Remove Python2 * Use Roboto font family Sans: Roboto (for text) "Serif": Roboto Slab (for headings) Monospace: Roboto Mono (for code) * Improve CSS navigation * Create new logo and move it to docs/_static * Add new section about how to get the version of semver * Use a more general term (2.x.y) instead of specific versions * Number sections * Rework deps for doc build * Rework release procedure
* Add `changelog.d/.gitignore` to keep this directory * Create `changelog.d/README.rst` with some descriptions * Add `changelog.d/_template.rst` as Towncrier template * Add `[tool.towncrier]` section in pyproject.toml * Add "changelog" target into `tox.ini`. Use it like "tox -e changes -- CMD" whereas CMD is a towncrier command. The default "tox -e changes" calls towncrier to create a draft of the changelog file and output it to stdout. * Update documentation and add include a new section "Changelog" included from `changelog.d/README.rst` * Update changelog.d directory and add new files
9808da4
to
0406432
Compare
I squashed all the commits that made the type hints work so it is clearer. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @tlaferriere for all your efforts! I left some comments to be discussed.
Apart from that, I've cloned your fork and tried to build it, but it failed. 😢 Haven't found the culprit yet. The result was: 73 failed, 227 passed
. Can you confirm? I've used the command tox -e py36
using Python 3.6.
You probably know that already, but I can highly recommend the pyenv project. This allows you to install different Python versions locally in your home without compromising the system installation. That makes it easier to test against different Python versions.
32b0c3d
to
8d61c9a
Compare
Thanks @tlaferriere for all your efforts with type hinting. Very much appreciated! 👍 ❤️ I've reorganized the commits a bit, squashed here and there. Your work is integrated into the commit messages, see PR python-semver#290. Furthermore, I've also added you as co-author. I additionally changed one thing: I've improved the API documentation. As we have type annotations now, I removed the manual types ( This makes the docstring more concise and improves readability. So with all the changes integrated in the above PR, I can close this PR. If you still find any issue, you are more than welcome to open a new one. Again, thanks for all your contributions! |
This is the conflict free version of python-semver#265. Should fix python-semver#213.