diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ecc7080..3c5ec4b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,6 +11,9 @@ on: types: - published + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + jobs: test: @@ -24,6 +27,7 @@ jobs: - 3.9 - "3.10" - "3.11" + - "3.12" include: - os: ubuntu-latest @@ -125,12 +129,12 @@ jobs: mypy --config-file tests/mypy.ini src/peakrdl_ipxact #------------------------------------------------------------------------------- - build_sdist: + build: needs: - test - lint - mypy - name: Build source distribution + name: Build distributions runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -140,19 +144,28 @@ jobs: with: python-version: "3.10" - - name: Build sdist - run: python setup.py sdist + - name: Install dependencies + run: | + python -m pip install -U build + + - name: Build + run: python -m build - uses: actions/upload-artifact@v3 with: - path: dist/*.tar.gz + path: | + dist/*.tar.gz + dist/*.whl #------------------------------------------------------------------------------- deploy: needs: - - build_sdist + - build runs-on: ubuntu-latest + environment: release + permissions: + id-token: write # Only publish when a GitHub Release is created. if: github.event_name == 'release' @@ -163,6 +176,3 @@ jobs: path: dist - uses: pypa/gh-action-pypi-publish@release/v1 - with: - user: __token__ - password: ${{ secrets.pypi_password }} diff --git a/.readthedocs.yaml b/.readthedocs.yaml new file mode 100644 index 0000000..354c013 --- /dev/null +++ b/.readthedocs.yaml @@ -0,0 +1,17 @@ +# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details + +version: 2 + +build: + os: ubuntu-22.04 + tools: + python: "3.11" + +sphinx: + configuration: docs/conf.py + +python: + install: + - requirements: docs/requirements.txt + - method: pip + path: . diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..3188ce6 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,54 @@ +[build-system] +requires = ["setuptools", "setuptools-scm"] +build-backend = "setuptools.build_meta" + +[project] +name = "peakrdl-ipxact" +dynamic = ["version"] +requires-python = ">=3.5.2" +dependencies = [ + "systemrdl-compiler >= 1.24.0, < 2", +] + +authors = [ + {name="Alex Mykyta"}, +] +description = "Import and export IP-XACT XML to/from the systemrdl-compiler register model" +readme = "README.md" +license = {file = "LICENSE"} +keywords = [ + "SystmRDL", "PeakRDL", "CSR", "compiler", "tool", "registers", "generator", + "IP-XACT", +] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", + "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 :: 3 :: Only", + "Intended Audience :: Developers", + "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", + "Operating System :: OS Independent", + "Topic :: Scientific/Engineering :: Electronic Design Automation (EDA)", +] + +[project.urls] +Documentation = "https://peakrdl-ipxact.readthedocs.io" +Source = "https://github.com/SystemRDL/PeakRDL-ipxact" +Tracker = "https://github.com/SystemRDL/PeakRDL-ipxact/issues" +Changelog = "https://github.com/SystemRDL/PeakRDL-ipxact/releases" + +[tool.setuptools.dynamic] +version = {attr = "peakrdl_ipxact.__about__.__version__"} + +[project.entry-points."peakrdl.exporters"] +ip-xact = "peakrdl_ipxact.__peakrdl__:Exporter" + +[project.entry-points."peakrdl.importers"] +ip-xact = "peakrdl_ipxact.__peakrdl__:Importer" diff --git a/setup.py b/setup.py deleted file mode 100644 index 7f24690..0000000 --- a/setup.py +++ /dev/null @@ -1,62 +0,0 @@ -import os -import setuptools - -with open("README.md", "r", encoding='utf-8') as fh: - long_description = fh.read() - - -with open(os.path.join("src/peakrdl_ipxact", "__about__.py"), encoding='utf-8') as f: - v_dict = {} - exec(f.read(), v_dict) - version = v_dict['__version__'] - -setuptools.setup( - name="peakrdl-ipxact", - version=version, - author="Alex Mykyta", - author_email="amykyta3@github.com", - description="Import and export IP-XACT XML to/from the systemrdl-compiler register model", - long_description=long_description, - long_description_content_type="text/markdown", - url="https://github.com/SystemRDL/PeakRDL-ipxact", - package_dir={'': 'src'}, - packages=[ - "peakrdl_ipxact", - ], - include_package_data=True, - python_requires='>=3.5.2', - install_requires=[ - "systemrdl-compiler >= 1.24.0, < 2", - ], - entry_points = { - "peakrdl.exporters": [ - 'ip-xact = peakrdl_ipxact.__peakrdl__:Exporter' - ], - "peakrdl.importers": [ - 'ip-xact = peakrdl_ipxact.__peakrdl__:Importer' - ] - }, - classifiers=( - "Development Status :: 5 - Production/Stable", - "Programming Language :: Python", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.5", - "Programming Language :: Python :: 3.6", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Programming Language :: Python :: 3 :: Only", - "Intended Audience :: Developers", - "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", - "Operating System :: OS Independent", - "Topic :: Scientific/Engineering :: Electronic Design Automation (EDA)", - ), - project_urls={ - "Documentation": "https://peakrdl-ipxact.readthedocs.io", - "Source": "https://github.com/SystemRDL/PeakRDL-ipxact", - "Tracker": "https://github.com/SystemRDL/PeakRDL-ipxact/issues", - "Changelog": "https://github.com/SystemRDL/PeakRDL-ipxact/releases", - }, -)