forked from minhtran83/python-semver
-
Notifications
You must be signed in to change notification settings - Fork 5
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
Merge code from upstream repo #3
Open
minhtran83
wants to merge
338
commits into
atlassian:master
Choose a base branch
from
python-semver:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The GH Action does basically this: 1. Setup Python 3.7 2. Install dependencies (mainly black) 3. Run black and create a diff file 4. Upload the diff as artifact Currently, it does not any pip caching (I had some problems with that; it didn't work reliably).
* Describe each target with `description` keyword; useful when running tox as `tox -a -v` * Move whitelist_externals to `textenv` section * Use `make` in `docs` target instead of running `sphinx-build` directly * Introduce black target to check for changes in formatting * Use `posargs` for flake8
* Use `docformatter` from https://github.com/myint/docformatter/ * Reformat `semver.py` to be compatible with PEP257 docstrings with `docformatter -i --pre-summary-newline semver.py` * `tox.ini` - Introduce `docstrings` target which calls `docformatter` to check for PEP257 compatible docstrings - Introduce a new `check` target which calls `black`, `flake8`, and `docstrings` * `.travis.yml` - Run `check` target instead of `flake8` - Add `before_install` section to install python3-dev package for black
* Use separate cmd_* functions for each subcommand * Replace which with func keyword * Use func keyword to store the specific cmd_* function * Adapt tests * (Re)format with black * Clarify return code in manpage (add new section "Return Code") => Easier to extend
* Document how to deal with invalid versions * Use coerce(version) as an example * Update CHANGELOG.rst Co-authored-by: scls19fr <[email protected]>
* Raise version number in `__version__` * Update CHANGELOG * Mention TestPyPI in `release-procedure.md` * MANIFEST.in: * Exclude `.travis.yml` * Exclude `.github` directory (pretty useless in an archive/wheel) * Exclude `docs/_build` directory * Exclude temporary Python files like `__pycache__`, `*.py[cod]` * Include all `*.txt` and `*.rst` files Co-authored-by: Sebastien Celles <[email protected]> Co-authored-by: scls19fr <[email protected]>
In class clean, replace super(CleanCommand, self).run() with CleanCommand.run(self) Co-authored-by: Dennis Menschel <[email protected]> Co-authored-by: Dennis Menschel <[email protected]>
* Fix typos in `README.rst`. * Move `coerce()` function into separate file; this was needed so it can be both included into the documentation and inside `conftest.py`. * In `docs/usage.rst`: - Fix typos - Add missing semver module name as prefix - Slightly rewrite some doctests which involves dicts (unfortunately, order matters still in Python2) * In `setup.cfg`: - Add `--doctest-glob` option to look for all `*.rst` files. - Add `testpaths` key to restrict testing paths to current dir and `docs`. * Update `CHANGELOG.rst`
Add better doctest integration into pytest
* Use ".. versionadded::" RST directive in docstrings to make it more visible when something was added * Minor wording fix in docstrings (versions -> version strings)
Add version information in some functions
* Add test cases - Add additional test case for "check" - test_should_process_check_iscalled_with_valid_version - Test also missing finalize_version - Test the warning more thoroughly with pytest.warns instead of just pytest.deprecated_call * In `setup.cfg`, add deprecation warnings filter for pytest * Implement DeprecationWarning with warnings module and the new decorator `deprecated` * Output a DeprecationWarning for the following functions: - semver.bump_{major,minor,patch,prerelease,build} - semver.format_version - semver.finalize_version - semver.parse - semver.parse_version_info - semver.replace - semver.VersionInfo._asdict - semver.VersionInfo._astuple Add also a deprecation notice in the docstrings of these functions * Introduce new public functions: - semver.VersionInfo.to_dict (from former _asdict) - semver.VersionInfo.to_tuple (from former _astuple) - Keep _asdict and _astuple as a (deprecated) function for compatibility reasons * Update CHANGELOG.rst * Update usage documentation: - Move some information to make them more useful for for the reader - Add deprecation warning - Explain how to replace deprecated functions - Explain how to display deprecation warnings from semver * Improve documentation of deprecated functions - List deprecated module level functions - Make recommendation and show equivalent code - Mention that deprecated functions will be replaced in semver 3. That means, all deprecated function will be still available in semver 2.x.y. * Move _increment_string into VersionInfo class - Makes removing deprecating functions easier as, for example, bump_prerelease is no longer dependant from an "external" function. - Move _LAST_NUMBER regex into VersionInfo class - Implement _increment_string as a staticmethod Co-authored-by: Karol <[email protected]> Co-authored-by: scls19fr <[email protected]> Co-authored-by: George Sakkis
Deprecate module level functions
* Module level functions like `semver.bump_version` are still available in the documentation, but they play a much less important role now. The preferred way is to use semver.Versioninfo instances to use. * Replace 2.9.2 -> 2.10.0 due to #237 * Fix docstring examples
Shift focus on semver.VersionInfo.* functions
Deprecate: * `semver.compare` -> `semver.VersionInfo.compare` * `semver.match` -> `semver.VersionInfo.match` Change: * Implementation of `semver.max_ver` and `semver.min_ver`
* Call self.compare(other) in all comparison operators. * Make sure, "other" is a compatible type (VersionInfo, dict, list, tuple, or string)
Fix #236: add missing deprecated functions
* Add __getitem__ to VersionInfo class * Add test cases * Add user documentation * Extend CHANGELOG Co-authored-by: Thomas Laferriere <[email protected]> Co-authored-by: Peter Bittner <[email protected]> Co-authored-by: Karol Werner <[email protected]> Co-authored-by: Sébastien Celles <[email protected]>
The VersionInfo.compare method allows already VersionInfo, dict, tuple/list and str. * Extend list of allowed types in comparator with list and str. * Rewrite case test_should_not_allow_to_compare_version_with_string -> test_should_compare_version_string * Add new test cases: - test_should_compare_version_list - test_should_not_allow_to_compare_invalid_versionstring * Use pytest.mark.parametrize for test_should_compare_version_tuples * Update usage.rst to document all possibilities * Update CHANGELOG
Synopsis: semver.VersionInfo.next_version(version, part, prerelease_token="rc") * Add test cases * test_next_version * test_next_version_with_invalid_parts * Reformat code with black * Document it in usage.rst * Implement "nextver" subcommand for pysemver command Co-authored-by: George Sakkis <[email protected]> Co-authored-By: Karol <[email protected]>
…build First implementation of next_version
Implement __getitem__ for #138
Fix #244: Allow list & str for comparison
Improve documentation wording & consistency
…erialization Fix #429: bug on serialization to json
Integrate additional topic that describes an high level overview about semver v2, v3, and v3 and beyond. Also revise section about "Release Policy" which is related. First mention semver3 and use semver2 later.
Clarify version policy for semver
* Downloads the inventories for Python and Pydantic * Use the correct :ref: syntax ("INVENTORY_NAME:OBJECT")
Improve external docs with intersphinx extension
Build 3.0.2 release of semver
* Remove :ref: in README.rst * Add tool.setuptools_scm section in pyproject.toml
According to [1], the .readthedocs.yaml configuration file is now required. The last builds have failed. [1] https://blog.readthedocs.com/migrate-configuration-v2/
If environment variable READTHEDOCS_CANONICAL_URL is definied, set html_baseurl variable so Sphinx can grab it.
Use meta directive for SEO
This makes it easier for users as if the TOC is long, the search box isn't visible anymore.
Move search box more at the top
Fix workflow
Improve type hints to fix TODOs
Gha add python313
* Remove obsolete else * Find a better way to identify digits without the re module * Fix docstring in compare
Improve private _nat_cmp() method
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.