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

Merge code from upstream repo #3

Open
wants to merge 338 commits into
base: master
Choose a base branch
from

Conversation

minhtran83
Copy link

No description provided.

tomschr and others added 30 commits November 24, 2019 18:24
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).
Also, fix problem with invalid Python 2.7 super call.
* Fix #201: Reformat source code with black

* Add `pyproject.toml` containing black configuration
* Add batch image in `README.rst`
* Reformat source code with `black`

* Add config for flake8

Use max-line-length of 88 (default for black)
* Remove uploading the diff file as artifact
* Use `--check` to test our source code
* 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
* VersionInfo.isvalid(cls, version:str) -> bool
* Add test case
* Describe function in documentation
* Amend pysemver script with "check" subcommand
* Update manpage (pysemver.rst)
* Update `CHANGELOG.rst`
* 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
* 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)
* 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
tomschr and others added 30 commits October 5, 2023 17:21
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.
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
Python workflow:
 * Exclude 3.7 on macos-latest
 * Use actions/checkout@v4 (migrated from @V3)
 * Enable Python 3.12, use action/setup-python@v5
 * Use newer syntax of "tox run ..."

CodeQL workflow:
* Update to latest version @V3
* Not be triggered in master, but in release/* branches
Improve type hints to fix TODOs
* 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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.