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

Migrate metadata from setup.py and setup.cfg to pyproject.toml #2517

Closed
wants to merge 2 commits into from
Closed
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
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
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ SORT_ARGS := -f -b

DICTIONARIES := codespell_lib/data/dictionary*.txt

PHONY := all check check-dictionaries sort-dictionaries trim-dictionaries check-dictionary sort-dictionary trim-dictionary check-manifest check-distutils flake8 pytest pypi clean
PHONY := all check check-dictionaries sort-dictionaries trim-dictionaries check-dictionary sort-dictionary trim-dictionary check-manifest check-pyproject flake8 pytest pypi clean
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
PHONY := all check check-dictionaries sort-dictionaries trim-dictionaries check-dictionary sort-dictionary trim-dictionary check-manifest check-pyproject flake8 pytest pypi clean
PHONY := all check check-dictionaries sort-dictionaries trim-dictionaries check-dictionary sort-dictionary trim-dictionary check-manifest check-pyproject check-distutils flake8 pytest pypi clean

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would run the code twice under two different names.


all: check-dictionaries codespell.1

check: check-dictionaries check-manifest check-distutils flake8 pytest
check: check-dictionaries check-manifest check-pyproject flake8 pytest

check-dictionary: check-dictionaries
sort-dictionary: sort-dictionaries
Expand Down Expand Up @@ -47,8 +47,8 @@ trim-dictionaries:
check-manifest:
check-manifest

check-distutils:
python setup.py check --restructuredtext --strict
check-pyproject:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May as well leave some backwards compatibility...

Suggested change
check-pyproject:
check-distutils: check-pyproject
check-pyproject:

Copy link
Contributor Author

@cclauss cclauss Oct 14, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

distutils will not be in py1.12 so this is probably a good time to change the name.

validate-pyproject

flake8:
flake8
Expand All @@ -57,7 +57,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%"
- '%PYTHON%\python.exe -m 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
67 changes: 67 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
[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/releases"

[project.optional-dependencies]
dev = [
"check-manifest",
"flake8",
"pytest",
"pytest-cov",
"pytest-dependency",
"tomli",
"validate-pyproject",
]
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.