diff options
| author | CoprDistGit <infra@openeuler.org> | 2023-04-12 00:38:30 +0000 |
|---|---|---|
| committer | CoprDistGit <infra@openeuler.org> | 2023-04-12 00:38:30 +0000 |
| commit | acf01965b3c987e084312fbb260844f81302c24a (patch) | |
| tree | 99e11e300ce4238b3661df39648cf6724fa14242 | |
| parent | f57c5b5c32b826aa3da1b267353fb5f249f05e40 (diff) | |
automatic import of python-pep440-version-utils
| -rw-r--r-- | .gitignore | 1 | ||||
| -rw-r--r-- | python-pep440-version-utils.spec | 361 | ||||
| -rw-r--r-- | sources | 1 |
3 files changed, 363 insertions, 0 deletions
@@ -0,0 +1 @@ +/pep440-version-utils-0.3.0.tar.gz diff --git a/python-pep440-version-utils.spec b/python-pep440-version-utils.spec new file mode 100644 index 0000000..038ed05 --- /dev/null +++ b/python-pep440-version-utils.spec @@ -0,0 +1,361 @@ +%global _empty_manifest_terminate_build 0 +Name: python-pep440-version-utils +Version: 0.3.0 +Release: 1 +Summary: Utilities to deal with pep440 versioning +License: MIT +URL: https://github.com/m-vdb/pep440-version-utils +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/b8/cf/fdf3501870629c1602b426f7589e09db7bce1dc97039f3f10d4d4dd767ab/pep440-version-utils-0.3.0.tar.gz +BuildArch: noarch + +Requires: python3-packaging + +%description + +[](https://coveralls.io/github/m-vdb/pep440-version-utils?branch=master) + +# pep440-version-utils +This package regroups utilities to deal with pep440 versioning. It is based on the +[PyPA's `packaging`](https://github.com/pypa/packaging) project and extends it. + +It makes it easier to handle version bumps and strictly follows [PEP440 specification](https://www.python.org/dev/peps/pep-0440/). + + + +## Installation + +Use `pip` or `poetry` to install this package: + +```bash +$ pip install pep440-version-utils + +# or alternatively +$ poetry add pep440-version-utils +``` + +## Usage + +Since this package extends the `packaging` library, so it supports version parsing and ordering as described +in [this documentation](https://packaging.pypa.io/en/latest/version/). + +To bump to a new release version: + +```python +from pep440_version_utils import Version + +version = Version("1.10.2") +version.next_micro() # 1.10.3 +version.next_minor() # 1.11.0 +version.next_major() # 2.0.0 +``` + +To bump to a new prerelease version: + +```python +from pep440_version_utils import Version + +version = Version("1.10.2") +version.next_alpha() # 1.10.3a1 +version.next_beta() # 1.10.3b1 +version.next_release_candidate() # 1.10.3rc1 + +version.next_alpha("minor") # 1.11.0a1 +version.next_beta("mior") # 1.11.0b1 +version.next_release_candidate("major") # 2.0.0rc1 +``` + +And it implements the full release cycle: + +```python +from pep440_version_utils import Version + +version = Version("1.10.2") +alpha1 = version.next_alpha() # 1.10.3a1 +alpha2 = alpha1.next_alpha() # 1.10.3a2 +beta1 = alpha2.next_beta() # 1.10.3b1 +rc1 = beta1.next_release_candidate() # 1.10.3rc1 +rc2 = rc1.next_release_candidate() # 1.10.3rc2 +new_version = rc2.next_micro() # 1.10.3 +``` + +You can also check if a version is a specific type of prerelease: +```python +from pep440_version_utils import Version + +Version("1.10.2a1").is_alpha # True +Version("1.10.2b2").is_beta # True +Version("1.10.2rc1").is_release_candidate # True +``` + +## Limitations + +This package doesn't support _post_, _dev_ and _local_ versions yet. **Contributions are welcome 😊** + +## How to contribute + +This package is fairly simple, here is how you can contribute: + +1. ⚙️ Install [`poetry`](https://python-poetry.org/) +2. 📦 In the repository folder, run `poetry install` +3. ✍️ Implement the desired changes +4. ✅ Run test, type checking and code quality checks: +```bash +$ poetry run black . --check +$ poetry run mypy */**.py --ignore-missing-imports +$ poetry run pytest --cov=pep440_version_utils +``` +5. ➡️ Submit a new pull request + +Do not hesitate to contribue, even for very small changes! + + +%package -n python3-pep440-version-utils +Summary: Utilities to deal with pep440 versioning +Provides: python-pep440-version-utils +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-pep440-version-utils + +[](https://coveralls.io/github/m-vdb/pep440-version-utils?branch=master) + +# pep440-version-utils +This package regroups utilities to deal with pep440 versioning. It is based on the +[PyPA's `packaging`](https://github.com/pypa/packaging) project and extends it. + +It makes it easier to handle version bumps and strictly follows [PEP440 specification](https://www.python.org/dev/peps/pep-0440/). + + + +## Installation + +Use `pip` or `poetry` to install this package: + +```bash +$ pip install pep440-version-utils + +# or alternatively +$ poetry add pep440-version-utils +``` + +## Usage + +Since this package extends the `packaging` library, so it supports version parsing and ordering as described +in [this documentation](https://packaging.pypa.io/en/latest/version/). + +To bump to a new release version: + +```python +from pep440_version_utils import Version + +version = Version("1.10.2") +version.next_micro() # 1.10.3 +version.next_minor() # 1.11.0 +version.next_major() # 2.0.0 +``` + +To bump to a new prerelease version: + +```python +from pep440_version_utils import Version + +version = Version("1.10.2") +version.next_alpha() # 1.10.3a1 +version.next_beta() # 1.10.3b1 +version.next_release_candidate() # 1.10.3rc1 + +version.next_alpha("minor") # 1.11.0a1 +version.next_beta("mior") # 1.11.0b1 +version.next_release_candidate("major") # 2.0.0rc1 +``` + +And it implements the full release cycle: + +```python +from pep440_version_utils import Version + +version = Version("1.10.2") +alpha1 = version.next_alpha() # 1.10.3a1 +alpha2 = alpha1.next_alpha() # 1.10.3a2 +beta1 = alpha2.next_beta() # 1.10.3b1 +rc1 = beta1.next_release_candidate() # 1.10.3rc1 +rc2 = rc1.next_release_candidate() # 1.10.3rc2 +new_version = rc2.next_micro() # 1.10.3 +``` + +You can also check if a version is a specific type of prerelease: +```python +from pep440_version_utils import Version + +Version("1.10.2a1").is_alpha # True +Version("1.10.2b2").is_beta # True +Version("1.10.2rc1").is_release_candidate # True +``` + +## Limitations + +This package doesn't support _post_, _dev_ and _local_ versions yet. **Contributions are welcome 😊** + +## How to contribute + +This package is fairly simple, here is how you can contribute: + +1. ⚙️ Install [`poetry`](https://python-poetry.org/) +2. 📦 In the repository folder, run `poetry install` +3. ✍️ Implement the desired changes +4. ✅ Run test, type checking and code quality checks: +```bash +$ poetry run black . --check +$ poetry run mypy */**.py --ignore-missing-imports +$ poetry run pytest --cov=pep440_version_utils +``` +5. ➡️ Submit a new pull request + +Do not hesitate to contribue, even for very small changes! + + +%package help +Summary: Development documents and examples for pep440-version-utils +Provides: python3-pep440-version-utils-doc +%description help + +[](https://coveralls.io/github/m-vdb/pep440-version-utils?branch=master) + +# pep440-version-utils +This package regroups utilities to deal with pep440 versioning. It is based on the +[PyPA's `packaging`](https://github.com/pypa/packaging) project and extends it. + +It makes it easier to handle version bumps and strictly follows [PEP440 specification](https://www.python.org/dev/peps/pep-0440/). + + + +## Installation + +Use `pip` or `poetry` to install this package: + +```bash +$ pip install pep440-version-utils + +# or alternatively +$ poetry add pep440-version-utils +``` + +## Usage + +Since this package extends the `packaging` library, so it supports version parsing and ordering as described +in [this documentation](https://packaging.pypa.io/en/latest/version/). + +To bump to a new release version: + +```python +from pep440_version_utils import Version + +version = Version("1.10.2") +version.next_micro() # 1.10.3 +version.next_minor() # 1.11.0 +version.next_major() # 2.0.0 +``` + +To bump to a new prerelease version: + +```python +from pep440_version_utils import Version + +version = Version("1.10.2") +version.next_alpha() # 1.10.3a1 +version.next_beta() # 1.10.3b1 +version.next_release_candidate() # 1.10.3rc1 + +version.next_alpha("minor") # 1.11.0a1 +version.next_beta("mior") # 1.11.0b1 +version.next_release_candidate("major") # 2.0.0rc1 +``` + +And it implements the full release cycle: + +```python +from pep440_version_utils import Version + +version = Version("1.10.2") +alpha1 = version.next_alpha() # 1.10.3a1 +alpha2 = alpha1.next_alpha() # 1.10.3a2 +beta1 = alpha2.next_beta() # 1.10.3b1 +rc1 = beta1.next_release_candidate() # 1.10.3rc1 +rc2 = rc1.next_release_candidate() # 1.10.3rc2 +new_version = rc2.next_micro() # 1.10.3 +``` + +You can also check if a version is a specific type of prerelease: +```python +from pep440_version_utils import Version + +Version("1.10.2a1").is_alpha # True +Version("1.10.2b2").is_beta # True +Version("1.10.2rc1").is_release_candidate # True +``` + +## Limitations + +This package doesn't support _post_, _dev_ and _local_ versions yet. **Contributions are welcome 😊** + +## How to contribute + +This package is fairly simple, here is how you can contribute: + +1. ⚙️ Install [`poetry`](https://python-poetry.org/) +2. 📦 In the repository folder, run `poetry install` +3. ✍️ Implement the desired changes +4. ✅ Run test, type checking and code quality checks: +```bash +$ poetry run black . --check +$ poetry run mypy */**.py --ignore-missing-imports +$ poetry run pytest --cov=pep440_version_utils +``` +5. ➡️ Submit a new pull request + +Do not hesitate to contribue, even for very small changes! + + +%prep +%autosetup -n pep440-version-utils-0.3.0 + +%build +%py3_build + +%install +%py3_install +install -d -m755 %{buildroot}/%{_pkgdocdir} +if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi +if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi +if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi +if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi +pushd %{buildroot} +if [ -d usr/lib ]; then + find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/lib64 ]; then + find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/bin ]; then + find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/sbin ]; then + find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst +fi +touch doclist.lst +if [ -d usr/share/man ]; then + find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst +fi +popd +mv %{buildroot}/filelist.lst . +mv %{buildroot}/doclist.lst . + +%files -n python3-pep440-version-utils -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Wed Apr 12 2023 Python_Bot <Python_Bot@openeuler.org> - 0.3.0-1 +- Package Spec generated @@ -0,0 +1 @@ +f6f214e99f1c3aa5814901af27920224 pep440-version-utils-0.3.0.tar.gz |
