-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Some cleanup and adopt hatch and ruff (#167)
Cleanup and hatch+ruff adoption * Cleanup of the project * Adopted hatch for test, coverage and other tasks * Adopdated ruff as the linter * Minimum supported Python is 3.8
- Loading branch information
Showing
19 changed files
with
134 additions
and
129 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,23 @@ | ||
.PHONY: build clean cover test upload | ||
.PHONY: build clean coverage upload-coverage test upload | ||
|
||
build: | ||
python setup.py sdist | ||
python setup.py bdist_wheel --universal | ||
hatch build | ||
|
||
clean: | ||
clean:coveralls | ||
rm -rf dist build pyswip.egg-info | ||
|
||
cover: | ||
py.test tests --verbose --cov=pyswip | ||
hatch run test:coverage | ||
|
||
upload-coverage: | ||
hatch run upload-coverage:coveralls | ||
|
||
test: | ||
py.test tests --verbose | ||
hatch run test:all | ||
|
||
upload: | ||
twine upload dist/* | ||
|
||
check: | ||
black --check . | ||
ruff format --check | ||
ruff check |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
black==24.4.2 | ||
pytest-cov==5.0.0 | ||
hatch==1.12.0 | ||
ruff==0.6.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,7 +25,7 @@ | |
|
||
|
||
def main(): | ||
p = Prolog() | ||
_ = Prolog() | ||
|
||
assertz = Functor("assertz") | ||
parent = Functor("parent", 2) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
[build-system] | ||
requires = ["hatchling"] | ||
build-backend = "hatchling.build" | ||
|
||
[project] | ||
name = "pyswip" | ||
dynamic = ["version"] | ||
description = "PySwip enables querying SWI-Prolog in your Python programs." | ||
readme = "README.md" | ||
requires-python = ">=3.8" | ||
license = "MIT" | ||
authors = [ | ||
{ name = "Yuce Tekol", email = "[email protected]" }, | ||
] | ||
keywords = [ | ||
"ai", | ||
"artificial intelligence", | ||
"ctypes", | ||
"ffi", | ||
"prolog", | ||
] | ||
classifiers = [ | ||
"Development Status :: 3 - Alpha", | ||
"Intended Audience :: Developers", | ||
"Intended Audience :: Science/Research", | ||
"License :: OSI Approved :: MIT License", | ||
"Operating System :: OS Independent", | ||
"Programming Language :: Python", | ||
"Topic :: Scientific/Engineering :: Artificial Intelligence", | ||
"Topic :: Software Development :: Libraries :: Python Modules", | ||
"Programming Language :: Python :: 3.8", | ||
"Programming Language :: Python :: 3.9", | ||
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Python :: 3.11", | ||
"Programming Language :: Python :: 3.12", | ||
"Programming Language :: Python :: Implementation :: CPython", | ||
] | ||
|
||
[project.urls] | ||
Download = "https://github.com/yuce/pyswip/releases" | ||
Homepage = "https://github.com/yuce/pyswip" | ||
|
||
[tool.hatch.version] | ||
path = "pyswip/__init__.py" | ||
|
||
[tool.hatch.build.targets.sdist] | ||
include = [ | ||
"/pyswip", | ||
] | ||
|
||
[tool.hatch.build.targets.wheel] | ||
packages = ["src/foo"] | ||
|
||
[tool.hatch.envs.test] | ||
dependencies = [ | ||
"pytest", | ||
"pytest-cov", | ||
] | ||
|
||
[tool.hatch.envs.test.scripts] | ||
all = "py.test tests --verbose" | ||
coverage = "py.test tests --verbose --cov=pyswip" | ||
|
||
[tool.hatch.envs.upload-coverage] | ||
dependencies = [ | ||
"coveralls", | ||
] | ||
|
||
[tool.hatch.envs.upload-coverage.scripts] | ||
coveralls = "coveralls" | ||
|
||
[tool.hatch.envs.types] | ||
extra-dependencies = [ | ||
"mypy>=1.0.0", | ||
] | ||
[tool.hatch.envs.types.scripts] | ||
check = "mypy --install-types --non-interactive {args:pyswip tests}" | ||
|
||
[tool.ruff.lint] | ||
ignore = ["F403", "F405", "E721"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.