Skip to content
Open
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: 0 additions & 2 deletions .devcontainer/post_create.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ sudo apt-get install -y libaspell-dev
pip install --upgrade \
aspell-python-py3 \
pip \
setuptools \
setuptools_scm \
wheel
pip install -e . --group dev

Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,9 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build twine
pip install build
- name: Build package
run: python -m build
- name: Check package
run: twine check --strict dist/*
- name: Check env vars
run: |
echo "Triggered by: ${{ github.event_name }}"
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ jobs:
run: |
python --version # just to check
python -m pip install --upgrade pip wheel
pip install --upgrade setuptools docutils setuptools_scm[toml] twine
pip install -e . --group dev # install the codespell dev packages
- run: pip install aspell-python-py3
if: startsWith(matrix.os, 'ubuntu')
Expand Down
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ trim-dictionaries: $(GENERATED)
check-dist:
$(eval TMP := $(shell mktemp -d))
python -m build -o $(TMP)
twine check --strict $(TMP)/*
rm -rf $(TMP)

ruff:
Expand Down
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -344,11 +344,11 @@ applied directly, but should instead be manually inspected. E.g.:
Development setup
-----------------

As suggested in the `Python Packaging User Guide`_, ensure ``pip``, ``setuptools``, and ``wheel`` are up to date before installing from source. Specifically you will need recent versions of ``setuptools`` and ``setuptools_scm``:
As suggested in the `Python Packaging User Guide`_, ensure ``pip`` and ``wheel`` are up to date before installing from source:

.. code-block:: sh

pip install --upgrade pip setuptools setuptools_scm wheel
pip install --upgrade pip wheel

You can install required dependencies for development by running the following within a checkout of the codespell source:

Expand Down
3 changes: 1 addition & 2 deletions codespell_lib/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from ._codespell import _script_main, main
from ._version import __version__ # type: ignore[import-not-found]
from ._codespell import __version__, _script_main, main

__all__ = ["__version__", "_script_main", "main"]
8 changes: 3 additions & 5 deletions codespell_lib/_codespell.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import tempfile
import textwrap
from collections.abc import Callable, Iterable, Sequence
from importlib.metadata import version
from re import Match, Pattern
from typing import (
Any,
Expand All @@ -45,10 +46,7 @@
from ._spellchecker import Misspelling, build_dict
from ._text_util import fix_case

# autogenerated by setuptools_scm
from ._version import ( # type: ignore[import-not-found]
__version__ as VERSION, # noqa: N812
)
__version__ = version("codespell")

word_regex_def = r"[\w\-'’]+" # noqa: RUF001
# While we want to treat characters like ( or " as okay for a starting break,
Expand Down Expand Up @@ -463,7 +461,7 @@ def convert_arg_line_to_args(self, arg_line: str) -> list[str]:
)

parser.set_defaults(colors=_supports_ansi_colors())
parser.add_argument("--version", action="version", version=VERSION)
parser.add_argument("--version", action="version", version=__version__)

parser.add_argument(
"-d",
Expand Down
34 changes: 8 additions & 26 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# https://setuptools.pypa.io/en/latest/userguide/pyproject_config.html
[build-system]
requires = ["flit_core>=3.11", "flit_scm"]
build-backend = "flit_scm:buildapi"

[project]
name = "codespell"
Expand Down Expand Up @@ -47,8 +49,7 @@ dev = [
"pytest-dependency",
"Pygments",
"ruff",
"tomli",
"twine"
"tomli"
]
types = [
"chardet>=5.1.0",
Expand All @@ -65,32 +66,13 @@ codespell = "codespell_lib:_script_main"
homepage = "https://github.com/codespell-project/codespell"
repository = "https://github.com/codespell-project/codespell"

[build-system]
build-backend = "setuptools.build_meta"
requires = ["setuptools>=77", "setuptools_scm[toml]>=6.2, != 8.0.0"]

# flit_scm uses setuptools_scm under the hood to write the version file at
# build time, so that flit can stamp the version into the package metadata.
[tool.setuptools_scm]
write_to = "codespell_lib/_version.py"

[tool.setuptools]
include-package-data = false

[tool.setuptools.packages.find]
include = ["codespell_lib", "codespell_lib.*"]
exclude = [
"dist",
"snap",
"tools",
"example",
"codespell_lib.tests*",
]

[tool.setuptools.package-data]
codespell_lib = [
"data/dictionary*.txt",
"data/linux-kernel.exclude",
"py.typed",
]
[tool.flit.module]
name = "codespell_lib"

# TODO: reintegrate codespell configuration after updating test cases
#[tool.codespell]
Expand Down
Loading