diff --git a/.github/workflows/build-publish.yml b/.github/workflows/build-publish.yml index e12b0d3e..23d3bda9 100644 --- a/.github/workflows/build-publish.yml +++ b/.github/workflows/build-publish.yml @@ -1,4 +1,4 @@ -name: Publish to PyPI +name: Publish to TestPyPI on: release: @@ -7,7 +7,7 @@ on: permissions: contents: read - id-token: write # required for PyPI Trusted Publishing (OIDC) + id-token: write # required for Trusted Publishing (OIDC) jobs: build: @@ -26,10 +26,13 @@ jobs: - name: Install build tooling run: | python -m pip install --upgrade pip - python -m pip install build twine + python -m pip install build twine wheel + + - name: Clean build artifacts + run: rm -rf dist build *.egg-info **/*.egg-info - name: Build sdist and wheel - run: python -m build + run: python -m build --wheel - name: Twine check run: python -m twine check dist/* @@ -43,7 +46,7 @@ jobs: publish: needs: build runs-on: ubuntu-latest - environment: pypi + environment: test-merlin steps: - name: Download dist artifacts uses: actions/download-artifact@v4 @@ -51,8 +54,9 @@ jobs: name: dist path: dist/ - - name: Publish to PyPI (Trusted Publishing) + - name: Publish to TestPyPI (Trusted Publishing) uses: pypa/gh-action-pypi-publish@release/v1 with: skip-existing: true packages-dir: dist/ + repository-url: https://test.pypi.org/legacy/ diff --git a/pyproject.toml b/pyproject.toml index c577fd75..c10e6bf0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,7 +2,6 @@ requires = [ "setuptools>=45", "wheel", - "scmver", "setuptools-scm>=8" ] build-backend = "setuptools.build_meta" @@ -73,18 +72,11 @@ source = "https://github.com/merlinquantum/merlin" issues = "https://github.com/merlinquantum/merlin/issues" [tool.setuptools] -package-dir = {"" = "src"} -packages = [ - "merlin", - "merlin.algorithms", - "merlin.bridge", - "merlin.builder", - "merlin.core", - "merlin.datasets", - "merlin.measurement", - "merlin.pcvl_pytorch", - "merlin.utils", -] + +[tool.setuptools.packages.find] +where = ["."] +include = ["merlin*"] +namespaces = false [tool.pytest.ini_options] testpaths = ["tests", "benchmarks"] @@ -182,4 +174,4 @@ ignore = [ quote-style = "double" indent-style = "space" skip-magic-trailing-comma = false -line-ending = "auto" +line-ending = "auto" \ No newline at end of file diff --git a/setup.py b/setup.py deleted file mode 100644 index 75bdd258..00000000 --- a/setup.py +++ /dev/null @@ -1,40 +0,0 @@ -# MIT License -# -# Copyright (c) 2025 Quandela -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. - -""" -Setup script for Merlin - Photonic Quantum Neural Networks. -""" - -from setuptools import find_packages, setup - -with open("README.md", encoding="utf-8") as fh: - long_description = fh.read() - -setup( - scmver=True, - setup_requires=["scmver"], - long_description=long_description, - package_dir={"": "."}, - packages=find_packages(), - include_package_data=True, - zip_safe=False, -)