From cea1f7a170ee11cc9edcb55e69a61035489ebddd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrique=20Silv=C3=A9rio?= <29920212+HGSilveri@users.noreply.github.com> Date: Tue, 24 Sep 2024 17:27:18 +0200 Subject: [PATCH] Isolating pulser-pasqal version and release process (#733) * Isolating pulser-pasqal version and release process * Delete version test --- packages.txt | 3 +-- pulser-pasqal/VERSION.txt | 1 + pulser-pasqal/pulser_pasqal/_version.py | 3 +-- pulser-pasqal/requirements.txt | 1 + pulser-pasqal/setup.py | 5 +---- setup.py | 7 ++++++- tests/test_pasqal.py | 5 ----- 7 files changed, 11 insertions(+), 14 deletions(-) create mode 100644 pulser-pasqal/VERSION.txt diff --git a/packages.txt b/packages.txt index c7698383..888e92d3 100644 --- a/packages.txt +++ b/packages.txt @@ -1,3 +1,2 @@ pulser-core -pulser-simulation -pulser-pasqal \ No newline at end of file +pulser-simulation \ No newline at end of file diff --git a/pulser-pasqal/VERSION.txt b/pulser-pasqal/VERSION.txt new file mode 100644 index 00000000..9d263216 --- /dev/null +++ b/pulser-pasqal/VERSION.txt @@ -0,0 +1 @@ +0.20.1 \ No newline at end of file diff --git a/pulser-pasqal/pulser_pasqal/_version.py b/pulser-pasqal/pulser_pasqal/_version.py index 7b37d81b..0ad1c76b 100644 --- a/pulser-pasqal/pulser_pasqal/_version.py +++ b/pulser-pasqal/pulser_pasqal/_version.py @@ -13,8 +13,7 @@ # limitations under the License. from pathlib import PurePath -# Sets the version to the same as 'pulser'. -version_file_path = PurePath(__file__).parent.parent.parent / "VERSION.txt" +version_file_path = PurePath(__file__).parent.parent / "VERSION.txt" with open(version_file_path, "r", encoding="utf-8") as f: __version__ = f.read().strip() diff --git a/pulser-pasqal/requirements.txt b/pulser-pasqal/requirements.txt index 7b3f97f8..12fb10e9 100644 --- a/pulser-pasqal/requirements.txt +++ b/pulser-pasqal/requirements.txt @@ -1,2 +1,3 @@ +pulser-core >= 0.20 pasqal-cloud ~= 0.12 backoff ~= 2.2 \ No newline at end of file diff --git a/pulser-pasqal/setup.py b/pulser-pasqal/setup.py index a202df7c..631cd4d2 100644 --- a/pulser-pasqal/setup.py +++ b/pulser-pasqal/setup.py @@ -25,9 +25,7 @@ current_directory = Path(__file__).parent # Reads the version from the VERSION.txt file -with open( - current_directory.parent / "VERSION.txt", "r", encoding="utf-8" -) as f: +with open(current_directory / "VERSION.txt", "r", encoding="utf-8") as f: __version__ = f.read().strip() # Changes to the directory where setup.py is @@ -35,7 +33,6 @@ with open("requirements.txt", encoding="utf-8") as f: requirements = f.read().splitlines() -requirements.append(f"pulser-core=={__version__}") # Stashes the source code for the local version file local_version_fpath = Path(package_name) / "_version.py" diff --git a/setup.py b/setup.py index 2e094929..5a739adc 100644 --- a/setup.py +++ b/setup.py @@ -25,8 +25,13 @@ "`make dev-install` instead." ) +# Pulser packages not pinned to __version__ +requirements = [ + "pulser-pasqal", +] +# Adding packages pinned to __version__ with open("packages.txt", "r", encoding="utf-8") as f: - requirements = [f"{pkg.strip()}=={__version__}" for pkg in f.readlines()] + requirements += [f"{pkg.strip()}=={__version__}" for pkg in f.readlines()] # Just a meta-package that requires all pulser packages setup( diff --git a/tests/test_pasqal.py b/tests/test_pasqal.py index 6382f589..bf7ee6f1 100644 --- a/tests/test_pasqal.py +++ b/tests/test_pasqal.py @@ -24,7 +24,6 @@ from pasqal_cloud.device.configuration import EmuFreeConfig, EmuTNConfig import pulser -import pulser_pasqal from pulser.backend.config import EmulatorConfig from pulser.backend.remote import ( BatchStatus, @@ -44,10 +43,6 @@ root = Path(__file__).parent.parent -def test_version(): - assert pulser_pasqal.__version__ == pulser.__version__ - - @dataclasses.dataclass class CloudFixture: pasqal_cloud: PasqalCloud