diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 48a27a1..ae50324 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,11 +9,16 @@ jobs: uses: actions/setup-python@master with: python-version: '3.10' + - name: Install dev dependencies + run : | + pip install -r requirements/dev.txt - name: Lint run: | - pip install -r requirements/dev.txt make lint - run: + - name: Build & check sdist & wheel + run: | + make dist/ + tests: runs-on: ${{ matrix.os }} strategy: matrix: diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index 7e6efac..0000000 --- a/MANIFEST.in +++ /dev/null @@ -1,3 +0,0 @@ -include README.rst -include LICENCE -include test_simpleeval.py diff --git a/Makefile b/Makefile index bcc6ba1..a767214 100644 --- a/Makefile +++ b/Makefile @@ -6,8 +6,8 @@ autotest: .PHONY: test -dist/: setup.cfg simpleeval.py README.rst - python -m build +dist/: pyproject.toml simpleeval.py README.rst + hatch build twine check dist/* pypi: test dist/ diff --git a/pyproject.toml b/pyproject.toml index c0eb5eb..3fa7662 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,54 @@ +[project] +name = "simpleeval" +version = "1.0.1" +requires-python = ">=3.9" +readme = "README.rst" +description = "A simple, safe single expression evaluator library." +licence = "MIT" +authors = [ + { name = "Daniel Fairhead", email = "danthedeckie@gmail.com" } +] +maintainers = [ + { name = "Daniel Fairhead", email = "danthedeckie@gmail.com" } +] +keywords = [ + "eval", "simple", "expression", "parse", "ast" +] + +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Intended Audience :: Developers", + "License :: OSI Approved :: MIT License", + "Topic :: Software Development :: Libraries :: Python Modules", + "Programming Language :: Python", +] +dependencies = [ + "pip>=24.2", +] + +[project.urls] +"Source code" = "https://github.com/danthedeckie/simpleeval" + +[pycodestyle] +max_line_length = 99 + [build-system] -requires = ["setuptools>=30.3.0", "wheel"] -build-backend = "setuptools.build_meta" +requires = ["hatchling"] +build-backend = "hatchling.build" + +[tool.hatch.build.targets.sdist] +include = [ + "simpleeval.py", + "test_simpleeval.py", + "README.rst", + "LICENCE", +] + +[tool.hatch.version] +path = "simpleeval.py" + +[tool.hatch.envs.hatch-test] +default-args = ["test_simpleeval.py"] [tool.black] line-length = 99 @@ -29,5 +77,4 @@ disable = [ "useless-object-inheritance", "unnecessary-pass", "bad-super-call", - ] - +] diff --git a/requirements/dev.txt b/requirements/dev.txt index 60e68af..a70b31c 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -1,2 +1,4 @@ ruff==0.6.9 mypy==1.11.2 +hatch==1.12.0 +twine==5.1.1 diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 52eba7b..0000000 --- a/setup.cfg +++ /dev/null @@ -1,24 +0,0 @@ -[metadata] -name = simpleeval -version = 1.0.0 -author = Daniel Fairhead -author_email = danthedeckie@gmail.com -description = A simple, safe single expression evaluator library. -keywords = eval, simple, expression, parse, ast -url = https://github.com/danthedeckie/simpleeval -license = MIT -long_description = file: README.rst -long_description_content_type = text/x-rst -classifiers = - Development Status :: 5 - Production/Stable - Intended Audience :: Developers - License :: OSI Approved :: MIT License - Topic :: Software Development :: Libraries :: Python Modules - Programming Language :: Python - -[options] -py_modules = simpleeval -python_requires = >=3.9 - -[pycodestyle] -max_line_length = 99