Skip to content

migrate from setup.cfg to pyproject.toml #118

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

Merged
merged 13 commits into from
May 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[run]
omit = tests/*
13 changes: 13 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[flake8]
max-complexity = 12
max-line-length = 88
exclude =
__pycache__/
.git/
.venv/
.pytest_cache/
show-source = true
statistics = true
count = true
per-file-ignores =
readchar/*_key.py:F403,F405
12 changes: 6 additions & 6 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
cache: pip
- name: Install dependencies
run: |
pip install setuptools wheel twine
pip install build twine
- name: get infos from Tag
run: |
echo "RELEASE_TAG=${RELEASE_TAG}"
Expand All @@ -55,12 +55,12 @@ jobs:
with:
script: core.setFailed('Invalid Tag name used with this release!')

- name: Write Version to __init__
- name: Write Version to pyproject.toml
run: |
sed -i "s/__version__ = .*/__version__ = '$VERSION'/" readchar/__init__.py
sed -i "s/version = \".*\"$/version = \"$VERSION\"/" pyproject.toml
- name: Build sdist and bdist_wheel
run: |
python setup.py sdist bdist_wheel
python -m build
- name: publish to PyPi
env:
TWINE_USERNAME: __token__
Expand All @@ -72,12 +72,12 @@ jobs:
if: ${{ env.VERSION_DEV }}
run: |
v=$VERSION_MAJOR.$VERSION_MINOR.$VERSION_PATCH-dev$((VERSION_DEV+1))
sed -i "s/__version__ = .*/__version__ = \"$v\"/" readchar/__init__.py
sed -i "s/version = \".*\"$/version = \"$v\"/" pyproject.toml
- name: increment patch version
if: ${{ !env.VERSION_DEV }}
run: |
v=$VERSION_MAJOR.$VERSION_MINOR.$((VERSION_PATCH+1))-dev0
sed -i "s/__version__ = .*/__version__ = \"$v\"/" readchar/__init__.py
sed -i "s/version = \".*\"$/version = \"$v\"/" pyproject.toml
- name: commit new version-number
uses: stefanzweifel/git-auto-commit-action@v4
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/run-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ jobs:
python-version: '3.x'
cache: pip
- run: |
pip install setuptools wheel
pip install build
- run: |
python setup.py sdist bdist_wheel
python -m build

pytest:
runs-on: ${{ matrix.os }}
Expand Down
4 changes: 4 additions & 0 deletions .isort.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[settings]
profile = black
src_paths = readchar,tests
lines_after_imports = 2
7 changes: 0 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,6 @@ repos:
- name: check python syntax
id: flake8

- repo: https://github.com/asottile/setup-cfg-fmt
rev: v2.5.0
hooks:
- name: format setup.cfg
id: setup-cfg-fmt
args: [--include-version-classifiers]

- repo: https://github.com/executablebooks/mdformat
rev: 0.7.16
hooks:
Expand Down
3 changes: 3 additions & 0 deletions .pytest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[pytest]
testpaths = tests
addopts = -r fEsxwX -s --cov=readchar
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ pre-commit precommit:
@pre-commit run -a

build pack readchar:
@python setup.py sdist bdist_wheel
@python -m build
43 changes: 43 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
[build-system]
requires = ["setuptools >= 61.0"]
build-backend = "setuptools.build_meta"

[project]
name = "readchar"
version = "4.1.0-dev3"
requires-python = ">= 3.8"
dependencies = []
authors = [
{ name = "Miguel Ángel García", email="[email protected]" },
{ name = "Jan Wille", email = "[email protected]" },
]
maintainers = [{ name = "Jan Wille", email = "[email protected]" }]
keywords = ["characters", "keystrokes", "stdin", "command line"]
classifiers = [
"Development Status :: 5 - Production/Stable",
"License :: OSI Approved :: MIT License",
"Operating System :: Microsoft :: Windows",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: Implementation :: CPython",
"Environment :: Console",
"Intended Audience :: Developers",
"Topic :: Software Development",
"Topic :: Software Development :: User Interfaces",
]
description = "Library to easily read single chars and key strokes"
readme = { file = "README.md", content-type = "text/markdown" }
license = { file = "LICENCE" }

[project.urls]
Homepage = "https://pypi.org/project/readchar"
#Documentation = "https://readthedocs.org"
Repository = "https://github.com/magmax/python-readchar"
Issues = "https://github.com/magmax/python-readchar/issues"
Changelog = "https://github.com/magmax/python-readchar/releases"
7 changes: 5 additions & 2 deletions readchar/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
"""Library to easily read single chars and key strokes"""
import importlib.metadata

__version__ = "4.0.7-dev0"

__doc__ = """Library to easily read single chars and key strokes"""

__version__ = importlib.metadata.version(__package__)
__all__ = ["readchar", "readkey", "key", "config"]

from sys import platform
Expand Down
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
-e .
build
pre-commit
pytest
pytest>=6.0
pytest-cov
wheel
81 changes: 0 additions & 81 deletions setup.cfg

This file was deleted.

10 changes: 0 additions & 10 deletions setup.py

This file was deleted.

Loading