Skip to content

Commit

Permalink
Modernize codebase
Browse files Browse the repository at this point in the history
- Require python 3.9 or newer
- Adopt new PEP517 packaging
- Update linters
- rename lib/ to src/
  • Loading branch information
ssbarnea committed Sep 12, 2023
1 parent 9e7d41f commit e118cda
Show file tree
Hide file tree
Showing 20 changed files with 251 additions and 352 deletions.
6 changes: 6 additions & 0 deletions .config/requirements.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
click-help-colors>=0.6
click>=8.1.4
enrich>=1.2.1
pygithub
pyyaml>=5.3.1
requests
14 changes: 7 additions & 7 deletions .github/workflows/tox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ jobs:
include:
- tox_env: lint
# - tox_env: docs
- tox_env: py36
- tox_env: py39
PREFIX: PYTEST_REQPASS=0
- tox_env: py37
- tox_env: py310
PREFIX: PYTEST_REQPASS=0
- tox_env: py38
- tox_env: py311
PREFIX: PYTEST_REQPASS=0
- tox_env: packaging
- tox_env: pkg

steps:
- uses: actions/checkout@v1
Expand Down Expand Up @@ -68,13 +68,13 @@ jobs:

env:
PY_COLORS: 1
TOXENV: packaging
TOXENV: pkg

steps:
- name: Switch to using Python 3.6 by default
- name: Switch to using Python 3.9 by default
uses: actions/setup-python@v2
with:
python-version: 3.6
python-version: 3.9
- name: Install tox
run: python -m pip install --user tox
- name: Check out src from Git
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,5 @@ pip-wheel-metadata
credentials.json

pip-wheel-metadata
src/gri/_version.py
report.html
2 changes: 0 additions & 2 deletions .isort.cfg

This file was deleted.

25 changes: 8 additions & 17 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
repos:
- repo: https://github.com/markdownlint/markdownlint
rev: v0.11.0
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.0.287"
hooks:
- id: markdownlint
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- repo: https://github.com/psf/black
rev: 23.9.1
hooks:
Expand All @@ -17,17 +18,6 @@ repos:
- id: check-executables-have-shebangs
- id: check-merge-conflict
- id: debug-statements
language_version: python3
- repo: https://github.com/PyCQA/flake8
rev: 4.0.1
hooks:
- id: flake8
additional_dependencies:
- pydocstyle>=5.1.1
- flake8-absolute-import
- flake8-black>=0.1.1
- flake8-docstrings>=1.5.0
language_version: python3
- repo: https://github.com/adrienverge/yamllint.git
rev: v1.26.3
hooks:
Expand All @@ -41,7 +31,7 @@ repos:
- id: mypy
# empty args needed in order to match mypy cli behavior
args: []
entry: mypy lib/
entry: mypy src/
pass_filenames: false
additional_dependencies:
- click-help-colors
Expand All @@ -52,13 +42,14 @@ repos:
- types-requests
- types-PyYAML
- types-dataclasses
- repo: https://github.com/pre-commit/mirrors-pylint
rev: v3.0.0a4
- repo: https://github.com/pylint-dev/pylint
rev: v2.17.5
hooks:
- id: pylint
additional_dependencies:
- click-help-colors
- click-option-group
- enrich
- packaging
- pygithub
- pyyaml
Expand Down
12 changes: 0 additions & 12 deletions .pylintrc

This file was deleted.

7 changes: 0 additions & 7 deletions MANIFEST.in

This file was deleted.

15 changes: 0 additions & 15 deletions mypy.ini

This file was deleted.

88 changes: 83 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,18 +1,96 @@
[build-system]
requires = [
"pip >= 19.3.1",
"setuptools >= 42",
"setuptools_scm[toml] >= 3.5.0",
"setuptools_scm_git_archive >= 1.1",
"wheel >= 0.33.6",
"setuptools >= 65.3.0", # required by pyproject+setuptools_scm integration and editable installs
"setuptools_scm[toml] >= 7.0.5", # required for "no-local-version" scheme

]
build-backend = "setuptools.build_meta"

[project]
# https://peps.python.org/pep-0621/#readme
requires-python = ">=3.9"
dynamic = ["version", "dependencies", "optional-dependencies"]
name = "gri"
description = "Git Review Interface for Gerrit and Github"
readme = "README.md"
authors = [{ "name" = "Sorin Sbarnea", "email" = "[email protected]" }]
maintainers = [{ "name" = "Sorin Sbarnea", "email" = "[email protected]" }]
license = { text = "MIT" }
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"Intended Audience :: Developers",
"Intended Audience :: Information Technology",
"Intended Audience :: System Administrators",
"License :: OSI Approved :: MIT License",
"Operating System :: MacOS",
"Operating System :: POSIX",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python",
"Topic :: System :: Systems Administration",
"Topic :: Software Development :: Quality Assurance",
"Topic :: Software Development :: Testing",
"Topic :: Utilities",
]
keywords = ["gerrit", "git", "github", "review"]

[project.urls]
homepage = "https://github.com/pycontribs/gri"
repository = "https://github.com/pycontribs/gri"
changelog = "https://github.com/pycontribs/gri/releases"

[project.scripts]
gri = "gri.__main__:cli"
grib = "gri.__main__:cli_bugs"

[tool.black]
target-version = ["py39"]
line-length = 88

[tool.isort]
profile = "black"

[tool.mypy]
python_version = 3.9
[[tool.mypy.overrides]]
module = [
"click_help_colors",
]
ignore_missing_imports = true
ignore_errors = true

[tool.pylint."MESSAGES CONTROL"]
disable = [
"missing-function-docstring",
"missing-class-docstring",
"missing-module-docstring"
]
[tool.ruff]
ignore = [
"ANN",
"ARG",
"D",
"DTZ",
"E501", # black managed
"PLR",
"PTH",
"S605",
"TRY",
]
select = ["ALL"]
target-version = "py39"
# Same as Black.
line-length = 88
[tool.setuptools.dynamic]
optional-dependencies.test = { file = [".config/requirements-test.txt"] }
optional-dependencies.lock = { file = [".config/requirements-lock.txt"] }
dependencies = { file = [".config/requirements.in"] }

[tool.setuptools_scm]
local_scheme = "no-local-version"
write_to = "src/gri/_version.py"
87 changes: 0 additions & 87 deletions setup.cfg

This file was deleted.

3 changes: 0 additions & 3 deletions setup.py

This file was deleted.

File renamed without changes.
Loading

0 comments on commit e118cda

Please sign in to comment.