Skip to content

Commit

Permalink
Migrate metadata from setup.py and setup.cfg to pyproject.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
cclauss committed Oct 6, 2022
1 parent 3ea9498 commit a2f6342
Show file tree
Hide file tree
Showing 8 changed files with 76 additions and 79 deletions.
3 changes: 3 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[flake8]
exclude = build, ci-helpers
ignore =
2 changes: 1 addition & 1 deletion .github/workflows/codespell-private.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
pip install codecov chardet "setuptools!=47.2.0" docutils
pip install aspell-python-py3
pip install -e ".[dev]" # install the codespell dev packages
- run: python setup.py install
- run: pip install .
- run: codespell --help
- run: make check
- run: codespell --check-filenames --skip="./.git/*,*.pyc,./codespell_lib/tests/test_basic.py,./codespell_lib/data/*,./example/code.c,./build/lib/codespell_lib/tests/test_basic.py,./build/lib/codespell_lib/data/*,README.rst,*.egg-info/*"
Expand Down
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ include COPYING
include bin/codespell
exclude *.yml *.yaml
exclude .coveragerc
exclude .flake8
exclude example example/* snap snap/* tools tools/*
exclude Makefile
exclude codespell.1.include
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ check-manifest:
check-manifest

check-distutils:
python setup.py check --restructuredtext --strict
echo "WARNING: 'make check-distutils' is disabled!!"
# python setup.py check --restructuredtext --strict

flake8:
flake8
Expand All @@ -57,7 +58,7 @@ pytest:
pytest codespell_lib

pypi:
python setup.py sdist register upload
sdist register upload

clean:
rm -rf codespell.1
3 changes: 2 additions & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ cache:

install:
- "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%"
- "pip install --upgrade pip"
- "pip install codecov chardet setuptools"
- "pip install -e \".[dev]\"" # install the codespell dev packages
- "python setup.py develop"
- "pip install ."

build: false # Not a C# project, build stuff at the test step instead.

Expand Down
66 changes: 66 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
[build-system]
requires = ["setuptools>=61.2"]
build-backend = "setuptools.build_meta"

[project]
name = "codespell"
dynamic = ["version"]
maintainers = [{name = "Lucas De Marchi", email = "[email protected]"}]
license = {text = "GPL v2"}
description = "Codespell"
classifiers = [
"Intended Audience :: Developers",
"License :: OSI Approved",
"Programming Language :: Python",
"Topic :: Software Development",
"Operating System :: Microsoft :: Windows",
"Operating System :: POSIX",
"Operating System :: Unix",
"Operating System :: MacOS",
]
requires-python = ">=3.7"

[project.readme]
file = "README.rst"
content-type = "text/x-rst"

[project.urls]
Homepage = "https://github.com/codespell-project/codespell/"
Download = "https://github.com/codespell-project/codespell/"

[project.optional-dependencies]
dev = [
"check-manifest",
"flake8",
"pytest",
"pytest-cov",
"pytest-dependency",
"tomli",
]
hard-encoding-detection = ["chardet"]
toml = ["tomli"]

[project.scripts]
codespell = "codespell_lib:_script_main"

[tool.setuptools]
packages = [
"codespell_lib",
"codespell_lib.tests",
"codespell_lib.data",
]
zip-safe = false
include-package-data = true
platforms = ["any"]

[tool.setuptools.dynamic]
version = {attr = "codespell_lib.__version__"}

[tool.setuptools.package-data]
codespell_lib = [
"data/dictionary*.txt",
"data/linux-kernel.exclude",
]

[tool.pytest.ini_options]
addopts = "--cov=codespell_lib -rs --cov-report= --tb=short"
6 changes: 0 additions & 6 deletions setup.cfg

This file was deleted.

69 changes: 0 additions & 69 deletions setup.py

This file was deleted.

0 comments on commit a2f6342

Please sign in to comment.