diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 65333eb..83032e8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,12 +19,13 @@ jobs: - uses: actions/setup-python@v5 with: python-version: ${{ matrix.py }} - - name: "Install requirements" - run: | - python -m pip install -r requirements-dev.txt + - name: Setup PDM + uses: pdm-project/setup-pdm@v4 + - name: Install dependencies + run: pdm install - name: "Run pytest" run: | - pytest + pdm run pytest check-typing: runs-on: ubuntu-latest @@ -33,5 +34,8 @@ jobs: - uses: actions/setup-python@v5 with: python-version: "3.9" - - run: pip install mypy - - run: mypy --install-types --non-interactive + - name: Setup PDM + uses: pdm-project/setup-pdm@v4 + - name: Install dependencies + run: pdm install + - run: pdm run mypy --install-types --non-interactive diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ce001a2..173a302 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,9 +14,10 @@ jobs: - uses: actions/setup-python@v5 with: python-version: 3.x - - run: | - python -m pip install setuptools wheel - python setup.py sdist bdist_wheel + - name: Install dependencies + run: python -m pip install build + - name: Build package + run: python -m build - uses: pypa/gh-action-pypi-publish@release/v1 with: password: ${{ secrets.PYPI_API_TOKEN }} diff --git a/mypy.ini b/mypy.ini deleted file mode 100644 index 601a8be..0000000 --- a/mypy.ini +++ /dev/null @@ -1,3 +0,0 @@ -[mypy] - -files = cmake_file_api diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..c737f8a --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,44 @@ +[project] +name = "cmake-file-api" +dynamic = ["version"] +description = "Read and interpret CMake's file-based API" +license = {text = "MIT"} +readme = {file = "README.md", content-type = "text/markdown"} +requires-python = ">=3.9" + +classifiers = [ + "Development Status :: 1 - Planning", + "Programming Language :: Python :: 3", + "Programming Language :: C", + "Programming Language :: C++", + "License :: OSI Approved :: MIT License", + "Operating System :: OS Independent" +] + +authors = [ + {name = "Anonymous Maarten", email = "anonymous.maarten@gmail.com"} +] + +[project.urls] +Homepage = "http://github.com/madebr/python-cmake-file-api" +Repository = "http://github.com/madebr/python-cmake-file-api" + +[build-system] +requires = ["setuptools>=65", "setuptools_scm[toml]>=7"] +build-backend = "setuptools.build_meta" + +[tool.setuptools.dynamic] +readme = {file = ["README.rst"]} + +[tool.setuptools_scm] + +[dependency-groups] +dev = [ + "pytest", + "mypy[install-types]" +] + +[tool.mypy] +files = [ + "cmake_file_api" +] diff --git a/requirements-dev.txt b/requirements-dev.txt deleted file mode 100644 index 4bfa28c..0000000 --- a/requirements-dev.txt +++ /dev/null @@ -1,2 +0,0 @@ -pytest -mypy diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 019511c..0000000 --- a/setup.cfg +++ /dev/null @@ -1,28 +0,0 @@ -[metadata] -name = cmake-file-api -license = MIT -author = Anonymous Maarten -author_email = anonymous.maarten@gmail.com -description = Read and interpret CMake's file-based API -long_description = file: README.md -long_description_content_type = text/markdown -url = http://github.com/madebr/python-cmake-file-api -classifiers = - Development Status :: 1 - Planning - Programming Language :: Python :: 3 - Programming Language :: C - Programming Language :: C++ - License :: OSI Approved :: MIT License - Operating System :: OS Independent - -[options] -python_requires = >=3.9 -packages=find: -setup_requires = - setuptools_scm - -[options.packages.find] -exclude = - tests - tests.* - *.tests diff --git a/setup.py b/setup.py deleted file mode 100644 index 0eb5031..0000000 --- a/setup.py +++ /dev/null @@ -1,4 +0,0 @@ -from setuptools import setup - - -setup(use_scm_version=True)