Skip to content

Commit

Permalink
codespell_lib/tests/ → tests/
Browse files Browse the repository at this point in the history
Source distributions such as sdist must include test directories.
Note that all files matching the pattern `test/test*.py` (or perhaps
`tests/test*.py` with an `s`?) are included implicitly:
	https://packaging.python.org/guides/using-manifest-in/#how-files-are-included-in-an-sdist

Binary distributions such as wheel must exclude test directories.
This seems to be done implicitly for top-level `tests/` directories
only. I do not know how to explicitly exclude files from binary
distributions. This setuptools issue might be of interest:
	pypa/setuptools-scm#190

I change `codespell_lib/tests/` to a top-level `tests/` directory as
a workaround. Not that I like it, but I currently lack an alternative.

Fixes (partially) codespell-project#2592.
  • Loading branch information
DimitriPapadopoulos committed Nov 17, 2022
1 parent 1302d79 commit cd8e202
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/codespell-private.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ jobs:
- run: codespell --version
- run: make check
- uses: codecov/codecov-action@v3
- 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/*"
- run: codespell --check-filenames --skip="./.git/*,*.pyc,./tests/test_basic.py,./codespell_lib/data/*,./example/code.c,./build/lib/tests/test_basic.py,./build/lib/codespell_lib/data/*,README.rst,*.egg-info/*"
# this file has an error
- run: "! codespell codespell_lib/tests/test_basic.py"
- run: "! codespell tests/test_basic.py"

make-check-dictionaries:
runs-on: ubuntu-latest
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ check-dictionaries:
fi; \
done
@if command -v pytest > /dev/null; then \
pytest codespell_lib/tests/test_dictionary.py; \
pytest tests/test_dictionary.py; \
else \
echo "Test dependencies not present, install using 'pip install -e \".[dev]\"'"; \
exit 1; \
Expand All @@ -55,7 +55,7 @@ flake8:

pytest:
@if command -v pytest > /dev/null; then \
pytest codespell_lib; \
pytest tests; \
else \
echo "Test dependencies not present, install using 'pip install -e \".[dev]\"'"; \
exit 1; \
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
global_pairs: Set[Tuple[str, str]] = set()

# Filename, should be seen as errors in aspell or not
_data_dir = op.join(op.dirname(__file__), '..', 'data')
_data_dir = op.join(op.dirname(__file__), '..', 'codespell_lib', 'data')
_fnames_in_aspell = [
(op.join(_data_dir, 'dictionary%s.txt' % d[2]), d[3:5], d[5:7])
for d in _builtin_dictionaries]
Expand Down

0 comments on commit cd8e202

Please sign in to comment.