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

Simplify types #800

Merged
merged 26 commits into from
Feb 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
8313086
chore: trim down mypy config
RonnyPfannschmidt Jan 17, 2023
3b09bb5
git tests: expect main as possible default branch
RonnyPfannschmidt Jan 17, 2023
acf0303
typing: consolidate version schemes types
RonnyPfannschmidt Jan 17, 2023
451f050
version: use precompiled regex for date_ver_match
RonnyPfannschmidt Jan 17, 2023
7f7cd29
Version class: turn into dataclass
RonnyPfannschmidt Jan 17, 2023
770d5dd
scmversion: stricter typing for tag
RonnyPfannschmidt Jan 17, 2023
91061f9
move private helpers to a private modue
RonnyPfannschmidt Jan 18, 2023
fd04e24
move entrypoints helpers to the belonging module
RonnyPfannschmidt Jan 18, 2023
4208223
move version type validation to version class
RonnyPfannschmidt Jan 18, 2023
8e4e22f
drop the deprecated version_from_scm helper
RonnyPfannschmidt Jan 18, 2023
45ad9c8
cut down on the exposed helpers in __init__.py
RonnyPfannschmidt Jan 18, 2023
bf0e813
remove the legacy version parser api
RonnyPfannschmidt Jan 18, 2023
78e7d6b
potential breaking: Configuration as dataclass
RonnyPfannschmidt Jan 18, 2023
ccd461b
drop unnecessary type-checking guards
RonnyPfannschmidt Jan 18, 2023
223a0c6
introduce config overries
RonnyPfannschmidt Jan 18, 2023
64a1840
ensure tag regex is a regex
RonnyPfannschmidt Jan 31, 2023
9eefd15
private configruation module
RonnyPfannschmidt Jan 31, 2023
f7c075a
correct git workdir passover and setuptools double call in
RonnyPfannschmidt Jan 31, 2023
3dff72a
prepare next gen package for pypi registration
RonnyPfannschmidt Feb 9, 2023
a5fdfcf
pre-commit updates
RonnyPfannschmidt Feb 12, 2023
1e22432
migrate setuptools config to pyproject.toml
RonnyPfannschmidt Feb 12, 2023
b4df9ef
add pyproject-fmt
RonnyPfannschmidt Feb 12, 2023
933e338
drop self check action for legacy setuptools
RonnyPfannschmidt Feb 12, 2023
d78d9cc
drop testing for old setuptools versions
RonnyPfannschmidt Feb 12, 2023
ee48e95
set minimal setuptools version higher for build
RonnyPfannschmidt Feb 13, 2023
850542e
changelog
RonnyPfannschmidt Feb 13, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 0 additions & 24 deletions .github/workflows/python-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,30 +85,6 @@ jobs:
architecture: x64
- run: pip install -e .[toml,test] pytest virtualenv
- run: pytest --test-legacy testing/test_setuptools_support.py || true # ignore fail flaky on ci
check_selfinstall:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python_version: [ '3.7', '3.9', 'pypy-3.8' ]
installer: ["pip install"]
name: check self install - Python ${{ matrix.python_version }} via ${{ matrix.installer }}
steps:
- uses: actions/checkout@v3
- name: Setup python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python_version }}
architecture: x64
# self install testing needs some clarity
# so its being executed without any other tools running
# setuptools smaller 52 is needed to do easy_install
- run: pip install -U "setuptools<52" tomli packaging typing_extensions importlib_metadata
- run: python setup.py egg_info
- run: python setup.py sdist
- run: ${{ matrix.installer }} dist/*
- run: python testing/check_self_install.py


dist:
runs-on: ubuntu-latest
Expand Down
14 changes: 7 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ default_language_version:
python: python3.9
repos:
- repo: https://github.com/psf/black
rev: 22.12.0
rev: 23.1.0
hooks:
- id: black
args: [--safe, --quiet]
Expand All @@ -27,13 +27,13 @@ repos:
hooks:
- id: pyupgrade
args: [--py37-plus]
- repo: https://github.com/asottile/setup-cfg-fmt
rev: v2.2.0
hooks:
- id: setup-cfg-fmt
args: [ --include-version-classifiers ]
- repo: https://github.com/tox-dev/pyproject-fmt
rev: "0.8.0"
hooks:
- id: pyproject-fmt

- repo: https://github.com/pre-commit/mirrors-mypy
rev: 'v0.991'
rev: 'v1.0.0'
hooks:
- id: mypy
args: [--strict]
Expand Down
36 changes: 31 additions & 5 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,29 @@
v8.0.0
======


breaking
--------
* remove legacy version parser api - config arg always required
* turn Configuration into a dataclass
* require confiuration to always pass into helpers

features
--------

* git: expect main as possible default branch
* drop version_from_scm helper
* trim down exposed public api
* no longer self-call twice in setuptools
* chores

* migrate own metadata to pyproject.toml
* consolidate version schemes
* stricter tag typing
* pre-compiled regex
* move helpers to private modules


v7.1.0
======

Expand Down Expand Up @@ -45,7 +71,7 @@ v7.0.0

* drop python 3.6 support
* include git archival support
* fix #707: support git version detection even when git protects against mistmatched owners
* fix #707: support git version detection even when git protects against mismatched owners
(common with misconfigured containers, thanks @chrisburr )

v6.4.3
Expand Down Expand Up @@ -410,7 +436,7 @@ v1.16.0
* avoid shlex.split on windows
* fix #218 - better handling of mercurial edge-cases with tag commits
being considered as the tagged commit
* fix #223 - remove the dependency on the interal SetupttoolsVersion
* fix #223 - remove the dependency on the internal ``SetuptoolsVersion``
as it was removed after long-standing deprecation

v1.15.7
Expand Down Expand Up @@ -612,20 +638,20 @@ v1.5.0

* moved setuptools integration related code to own file
* support storing version strings into a module/text file
using the :code:`write_to` coniguration parameter
using the :code:`write_to` configuration parameter

v1.4.0
======

* proper handling for sdist
* fix file-finder failure from windows
* resuffle docs
* reshuffle docs

v1.3.0
======

* support setuptools easy_install egg creation details
by hardwireing the version in the sdist
by hardwire-ing the version in the sdist

v1.2.0
======
Expand Down
3 changes: 2 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ include *.rst
include LICENSE
include *.toml
include mypy.ini
include testing/Dockerfile.busted-buster
include testing/Dockerfile.*
include src/setuptools_scm/.git_archival.txt
recursive-include testing *.bash
4 changes: 0 additions & 4 deletions mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,4 @@ python_version = 3.7
warn_return_any = True
warn_unused_configs = True
mypy_path = $MYPY_CONFIG_FILE_DIR/src

[mypy-setuptools_scm.*]
# disabled as it will take a bit
# disallow_untyped_defs = True
strict = true
9 changes: 9 additions & 0 deletions nextgen/vcs-versioning/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
MIT License

Copyright (c) 2023-present Ronny Pfannschmidt

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 changes: 21 additions & 0 deletions nextgen/vcs-versioning/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# vcs-versioning

[![PyPI - Version](https://img.shields.io/pypi/v/vcs-versioning.svg)](https://pypi.org/project/vcs-versioning)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/vcs-versioning.svg)](https://pypi.org/project/vcs-versioning)

-----

**Table of Contents**

- [Installation](#installation)
- [License](#license)

## Installation

```console
pip install vcs-versioning
```

## License

`vcs-versioning` is distributed under the terms of the [MIT](https://spdx.org/licenses/MIT.html) license.
64 changes: 64 additions & 0 deletions nextgen/vcs-versioning/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
[build-system]
build-backend = "hatchling.build"
requires = [
"hatchling",
]

[project]
name = "vcs-versioning"
description = "the blessed package to manage your versions by vcs metadata"
readme = "README.md"
keywords = [
]
license = "MIT"
authors = [
{ name = "Ronny Pfannschmidt", email = "[email protected]" },
]
requires-python = ">=3.8"
classifiers = [
"Development Status :: 1 - Planning",
"Programming Language :: Python",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
]
dynamic = [
"version",
]
dependencies = [
]
[project.urls]
Documentation = "https://github.com/unknown/vcs-versioning#readme"
Issues = "https://github.com/unknown/vcs-versioning/issues"
Source = "https://github.com/unknown/vcs-versioning"


[tool.hatch.version]
path = "vcs_versioning/__about__.py"

[tool.hatch.envs.default]
dependencies = [
"pytest",
"pytest-cov",
]
[tool.hatch.envs.default.scripts]
cov = "pytest --cov-report=term-missing --cov-config=pyproject.toml --cov=vcs_versioning --cov=tests {args}"
no-cov = "cov --no-cov {args}"

[[tool.hatch.envs.test.matrix]]
python = ["38", "39", "310", "311"]

[tool.coverage.run]
branch = true
parallel = true
omit = [
"vcs_versioning/__about__.py",
]

[tool.coverage.report]
exclude_lines = [
"no cov",
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
]
1 change: 1 addition & 0 deletions nextgen/vcs-versioning/tests/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from __future__ import annotations
3 changes: 3 additions & 0 deletions nextgen/vcs-versioning/vcs_versioning/__about__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from __future__ import annotations

__version__ = "0.0.1"
1 change: 1 addition & 0 deletions nextgen/vcs-versioning/vcs_versioning/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from __future__ import annotations
95 changes: 91 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,94 @@
[build-system]
build-backend = "setuptools.build_meta"
requires = [
"setuptools>=45",
"packaging>=20.0",
"typing_extensions",
"packaging>=20",
"setuptools>=55",
"typing_extensions",
]
build-backend = "setuptools.build_meta"

[project]
name = "setuptools-scm"
description = "the blessed package to manage your versions by scm tags"
readme = "README.rst"
license.file = "LICENSE"
authors = [
{name="Ronny Pfannschmidt", email="[email protected]"}
]
requires-python = ">=3.7"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Topic :: Software Development :: Libraries",
"Topic :: Software Development :: Version Control",
"Topic :: System :: Software Distribution",
"Topic :: Utilities",
]
dynamic = [
"version",
]
dependencies = [
'importlib-metadata; python_version < "3.8"',
"packaging>=20",
"setuptools",
'tomli>=1; python_version < "3.11"',
"typing-extensions",
]
[project.urls]
repository = "https://github.com/pypa/setuptools_scm/"

[project.entry-points."distutils.setup_keywords"]
use_scm_version = "setuptools_scm.integration:version_keyword"

[project.entry-points."setuptools.file_finders"]
setuptools_scm = "setuptools_scm.integration:find_files"

[project.entry-points."setuptools.finalize_distribution_options"]
setuptools_scm = "setuptools_scm.integration:infer_version"

[project.entry-points."setuptools_scm.files_command"]
".git" = "setuptools_scm.file_finder_git:git_find_files"
".hg" = "setuptools_scm.file_finder_hg:hg_find_files"

[project.entry-points."setuptools_scm.files_command_fallback"]
".git_archival.txt" = "setuptools_scm.file_finder_git:git_archive_find_files"
".hg_archival.txt" = "setuptools_scm.file_finder_hg:hg_archive_find_files"

[project.entry-points."setuptools_scm.local_scheme"]
dirty-tag = "setuptools_scm.version:get_local_dirty_tag"
no-local-version = "setuptools_scm.version:get_no_local_node"
node-and-date = "setuptools_scm.version:get_local_node_and_date"
node-and-timestamp = "setuptools_scm.version:get_local_node_and_timestamp"

[project.entry-points."setuptools_scm.parse_scm"]
".git" = "setuptools_scm.git:parse"
".hg" = "setuptools_scm.hg:parse"

[project.entry-points."setuptools_scm.parse_scm_fallback"]
".git_archival.txt" = "setuptools_scm.git:parse_archival"
".hg_archival.txt" = "setuptools_scm.hg:parse_archival"
PKG-INFO = "setuptools_scm.hacks:parse_pkginfo"
pip-egg-info = "setuptools_scm.hacks:parse_pip_egg_info"
"pyproject.toml" = "setuptools_scm.hacks:fallback_version"
"setup.py" = "setuptools_scm.hacks:fallback_version"

[project.entry-points."setuptools_scm.version_scheme"]
"calver-by-date" = "setuptools_scm.version:calver_by_date"
"guess-next-dev" = "setuptools_scm.version:guess_next_dev_version"
"no-guess-dev" = "setuptools_scm.version:no_guess_dev_version"
"post-release" = "setuptools_scm.version:postrelease_version"
"python-simplified-semver" = "setuptools_scm.version:simplified_semver_version"
"release-branch-semver" = "setuptools_scm.version:release_branch_semver_version"



[tool.setuptools.packages.find]
where = ["src"]
Loading