From f80e89ad1256c6508d58686d78025794e4f520f8 Mon Sep 17 00:00:00 2001 From: "aditya.khot" Date: Wed, 18 Feb 2026 14:54:05 +0100 Subject: [PATCH 1/4] update workflow, fixed bug to create build distribution --- .github/workflows/build-publish.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-publish.yml b/.github/workflows/build-publish.yml index e12b0d3e..a0d32974 100644 --- a/.github/workflows/build-publish.yml +++ b/.github/workflows/build-publish.yml @@ -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 setup.py sdist bdist_wheel - name: Twine check run: python -m twine check dist/* From 62898c57972c476a4c15975f6d7984e2e00992bc Mon Sep 17 00:00:00 2001 From: Mario Valdivia <96960683+mario-valdivia@users.noreply.github.com> Date: Wed, 18 Mar 2026 18:00:28 +0100 Subject: [PATCH 2/4] using build --wheel --- .github/workflows/build-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-publish.yml b/.github/workflows/build-publish.yml index a0d32974..60084991 100644 --- a/.github/workflows/build-publish.yml +++ b/.github/workflows/build-publish.yml @@ -32,7 +32,7 @@ jobs: run: rm -rf dist build *.egg-info **/*.egg-info - name: Build sdist and wheel - run: python setup.py sdist bdist_wheel + run: python -m build --wheel - name: Twine check run: python -m twine check dist/* From dec2f2504c56797b453ace47a753655e5d50f9b0 Mon Sep 17 00:00:00 2001 From: Cassandre Notton Date: Wed, 18 Mar 2026 15:17:48 -0400 Subject: [PATCH 3/4] Remove scmver to only keep setuptools_scm and replaced package broad discovery with constrained discovery --- pyproject.toml | 20 ++++++-------------- setup.py | 40 ---------------------------------------- 2 files changed, 6 insertions(+), 54 deletions(-) delete mode 100644 setup.py 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, -) From da0d4030af53df9e98d1352b58c26bf3ad860e13 Mon Sep 17 00:00:00 2001 From: Cassandre Notton Date: Wed, 18 Mar 2026 15:23:19 -0400 Subject: [PATCH 4/4] Adpated to pypi --- .github/workflows/build-publish.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-publish.yml b/.github/workflows/build-publish.yml index 60084991..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: @@ -46,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 @@ -54,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/