Skip to content

Pyproject support #34

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

Merged
merged 39 commits into from
Feb 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
b2e74b5
pyproject.toml poetry file
gpongelli Jan 22, 2023
7d36495
search for pyproject.toml file
gpongelli Jan 22, 2023
45540d7
add library to parse pyproject and add new file to SOURCES
gpongelli Jan 22, 2023
fd5c470
implement pieces for pyproject.toml handling
gpongelli Jan 22, 2023
51c045f
return FileLines instead of dict
gpongelli Jan 24, 2023
f54b957
first version for tests
gpongelli Jan 24, 2023
d8bc619
build-system seems interfere with appveyor
gpongelli Jan 24, 2023
a5a6565
fix deprecation warning
gpongelli Jan 24, 2023
b15d091
indentation
gpongelli Jan 24, 2023
08a92d5
fix message when no required files are present
gpongelli Jan 24, 2023
16f0c7d
toml does not need comma
gpongelli Jan 24, 2023
76c40f2
removed version from toml
gpongelli Jan 24, 2023
483d27b
using tomlkit package
gpongelli Jan 24, 2023
0aca989
moved to tomlkit, small set of working tests
gpongelli Jan 24, 2023
ac1b95d
manage different tools that use pyproject.toml
gpongelli Jan 24, 2023
dad4492
renamed module to generic pyproject.py
gpongelli Jan 24, 2023
8a515de
renamed objects removing poetry reference
gpongelli Jan 24, 2023
7ea9050
tool.setuptools is optional table
gpongelli Jan 25, 2023
12c5265
removed wrong test
gpongelli Jan 25, 2023
ed48eda
same test name as setup.py
gpongelli Jan 25, 2023
d748483
unsupported dynamic format on toml file
gpongelli Jan 25, 2023
583c366
manage StringIO input
gpongelli Jan 25, 2023
b10da17
fixed latest tests
gpongelli Jan 25, 2023
8349504
setuptools pyproject test and implementation
gpongelli Jan 25, 2023
c7e1623
renamed files to have all pyproject tests with same prefix
gpongelli Jan 25, 2023
82c67ea
added flit implementation and tests
gpongelli Jan 25, 2023
63e735a
fix trailing whitespace
gpongelli Jan 25, 2023
7ed0b9a
review comments
gpongelli Jan 25, 2023
605fe9a
pass flake8 tests
gpongelli Jan 25, 2023
c166aed
new tests for cli
gpongelli Jan 25, 2023
f2c7d21
fix after latest changes
gpongelli Jan 25, 2023
2a0d7d4
fix test
gpongelli Jan 25, 2023
1214b38
fix isort stage
gpongelli Jan 26, 2023
572ca6e
install tomlkit for mypy run
gpongelli Jan 26, 2023
7e471e4
fix mypy checks
gpongelli Jan 26, 2023
4539a49
removed unused pyproject.toml file
gpongelli Jan 27, 2023
f1cb32e
checks done in previous call on the chain
gpongelli Jan 27, 2023
de13d7a
new tests and changes to reach 100%
gpongelli Jan 27, 2023
04c8988
test file names
gpongelli Jan 27, 2023
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
4 changes: 2 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
universal = 1

[metadata]
license_file = LICENSE
license_files = LICENSE

[zest.releaser]
python-file-with-version = src/check_python_versions/__init__.py
Expand All @@ -13,7 +13,7 @@ include_trailing_comma = true
lines_after_imports = 2
reverse_relative = true
known_first_party = check_python_versions
known_third_party = pytest, yaml
known_third_party = pytest, yaml, tomlkit
skip = check-python-versions

[mypy]
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,6 @@
'check-python-versions = check_python_versions.cli:main',
],
},
install_requires=['pyyaml'],
install_requires=['pyyaml', 'tomlkit'],
zip_safe=False,
)
6 changes: 3 additions & 3 deletions src/check_python_versions/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,9 @@ def is_package(where: str = '.') -> bool:

Does not emit any diagnostics.
"""
# TODO: support setup.py-less packages that use pyproject.toml instead
setup_py = os.path.join(where, 'setup.py')
return os.path.exists(setup_py)
pyproject_toml = os.path.join(where, 'pyproject.toml')
return os.path.exists(setup_py) or os.path.exists(pyproject_toml)


PrintFn = Callable[..., None]
Expand All @@ -126,7 +126,7 @@ def check_package(where: str = '.', *, print: PrintFn = print) -> bool:
return False

if not is_package(where):
print("no setup.py -- not a Python package?")
print("no setup.py or pyproject.toml -- not a Python package?")
return False

return True
Expand Down
3 changes: 3 additions & 0 deletions src/check_python_versions/sources/all.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from .appveyor import Appveyor
from .github import GitHubActions
from .manylinux import Manylinux
from .pyproject import PyProject, PyProjectPythonRequires
from .setup_py import SetupClassifiers, SetupPythonRequires
from .tox import Tox
from .travis import Travis
Expand All @@ -12,6 +13,8 @@
ALL_SOURCES = [
SetupClassifiers,
SetupPythonRequires,
PyProject,
PyProjectPythonRequires,
Tox,
Travis,
GitHubActions,
Expand Down
Loading