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 343 commits into
base: master
Choose a base branch
from

Conversation

minhtran83
Copy link

No description provided.

tomschr and others added 30 commits December 7, 2019 23:04
* 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
* README.rst: Remove :ref: role as it gives problems in twine
* setup.py: add project URLs
* Amend list of contributors
* Mention how to install semver from master
* tox.ini: added prepare-dist target to create distribution (whl
  and .tar.gz) and check with "twine check"
Defines default behaviour when executing
`from semver import *` (although it's considered
bad coding practice).

Raise version to 2.10.1.

See also:
https://docs.python.org/3/tutorial/modules.html#importing-from-a-package
Add __all__ to provide explict index of semver
Use obs:// scheme instead of the longer http://. The former
has the additional advantage, that the current release
is automatically detected.

Co-authored-by: Martin Rey <[email protected]>
tomschr and others added 30 commits October 9, 2023 10:52
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
* Raise version to 3.0.3-alpha.1
* In pyproject.toml:
  - Use new dependency group from PEP 735
  - Move all project related data from setup.cfg to pyproject.toml
  - Consolidate flake8, pycodestyle with ruff
  - Split Towncrier config type "trivial" into "trivial" and
    "internal"
* Add uv's lock file (uv.lock)
* Create config file for ruff (.ruff.toml)
* Create config file for pytest (.pytest.ini)
* Simplify tox.ini and remove old stuff
* Document installation with new uv command
* Simplify Sphinx config with find_version()
* Update the authors
* Use uv in GitHub Action python-testing.yml workflow
Modernize project configs with pyproject.toml
The YAML format defines an issue form. This makes it
(hopefully) easier to add more consistent bug reports.
Turn our Markdown issue templates into YAML
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.