diff --git a/VERSION.txt b/VERSION.txt index 91bfe5b2b..e815b861f 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -0.16dev0 +0.15.1 diff --git a/docs/source/conf.py b/docs/source/conf.py index 86bba145c..507fb0657 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -15,7 +15,7 @@ sys.path.insert(0, os.path.abspath("../../")) -with open("../../VERSION.txt", "r") as f: +with open("../../VERSION.txt", "r", encoding="utf-8") as f: __version__ = f.read().strip() # -- Project information ----------------------------------------------------- diff --git a/pulser-core/pulser/devices/interaction_coefficients/__init__.py b/pulser-core/pulser/devices/interaction_coefficients/__init__.py index 1c12ee4c1..4b45147e6 100644 --- a/pulser-core/pulser/devices/interaction_coefficients/__init__.py +++ b/pulser-core/pulser/devices/interaction_coefficients/__init__.py @@ -23,6 +23,8 @@ import json from pathlib import PurePath -with open(PurePath(__file__).parent / "C6_coeffs.json") as f: +with open( + PurePath(__file__).parent / "C6_coeffs.json", "r", encoding="utf-8" +) as f: _json_dict = json.load(f) c6_dict = {int(key): value for key, value in _json_dict.items()} diff --git a/pulser-core/pulser/json/abstract_repr/__init__.py b/pulser-core/pulser/json/abstract_repr/__init__.py index 040db5803..6137a18ed 100644 --- a/pulser-core/pulser/json/abstract_repr/__init__.py +++ b/pulser-core/pulser/json/abstract_repr/__init__.py @@ -18,5 +18,7 @@ SCHEMAS_PATH = Path(__file__).parent / "schemas" SCHEMAS = {} for obj_type in ("device", "sequence"): - with open(SCHEMAS_PATH / f"{obj_type}-schema.json") as f: + with open( + SCHEMAS_PATH / f"{obj_type}-schema.json", "r", encoding="utf-8" + ) as f: SCHEMAS[obj_type] = json.load(f) diff --git a/pulser-core/setup.py b/pulser-core/setup.py index 0928bed64..6db9e8e06 100644 --- a/pulser-core/setup.py +++ b/pulser-core/setup.py @@ -21,22 +21,24 @@ current_directory = Path(__file__).parent # Reads the version from the VERSION.txt file -with open(current_directory.parent / "VERSION.txt", "r") as f: +with open( + current_directory.parent / "VERSION.txt", "r", encoding="utf-8" +) as f: __version__ = f.read().strip() # Changes to the directory where setup.py is os.chdir(current_directory) -with open("requirements.txt") as f: +with open("requirements.txt", "r", encoding="utf-8") as f: requirements = f.read().splitlines() # Stashes the source code for the local version file local_version_fpath = Path(package_name) / "_version.py" -with open(local_version_fpath, "r") as f: +with open(local_version_fpath, "r", encoding="utf-8") as f: stashed_version_source = f.read() # Overwrites the _version.py for the source distribution (reverted at the end) -with open(local_version_fpath, "w") as f: +with open(local_version_fpath, "w", encoding="utf-8") as f: f.write(f"__version__ = '{__version__}'\n") setup( @@ -47,7 +49,7 @@ package_data={package_name: ["py.typed"]}, include_package_data=True, description="A pulse-level composer for neutral-atom quantum devices.", - long_description=open("README.md").read(), + long_description=open("README.md", "r", encoding="utf-8").read(), long_description_content_type="text/markdown", author="Pulser Development Team", python_requires=">=3.8", @@ -61,5 +63,5 @@ ) # Restores the original source code of _version.py -with open(local_version_fpath, "w") as f: +with open(local_version_fpath, "w", encoding="utf-8") as f: f.write(stashed_version_source) diff --git a/pulser-pasqal/pulser_pasqal/_version.py b/pulser-pasqal/pulser_pasqal/_version.py index 08126f2ae..7b37d81be 100644 --- a/pulser-pasqal/pulser_pasqal/_version.py +++ b/pulser-pasqal/pulser_pasqal/_version.py @@ -16,5 +16,5 @@ # Sets the version to the same as 'pulser'. version_file_path = PurePath(__file__).parent.parent.parent / "VERSION.txt" -with open(version_file_path, "r") as f: +with open(version_file_path, "r", encoding="utf-8") as f: __version__ = f.read().strip() diff --git a/pulser-pasqal/setup.py b/pulser-pasqal/setup.py index 228289bbe..a202df7c8 100644 --- a/pulser-pasqal/setup.py +++ b/pulser-pasqal/setup.py @@ -25,23 +25,25 @@ current_directory = Path(__file__).parent # Reads the version from the VERSION.txt file -with open(current_directory.parent / "VERSION.txt", "r") as f: +with open( + current_directory.parent / "VERSION.txt", "r", encoding="utf-8" +) as f: __version__ = f.read().strip() # Changes to the directory where setup.py is os.chdir(current_directory) -with open("requirements.txt") as f: +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" -with open(local_version_fpath, "r") as f: +with open(local_version_fpath, "r", encoding="utf-8") as f: stashed_version_source = f.read() # Overwrites the _version.py for the source distribution (reverted at the end) -with open(local_version_fpath, "w") as f: +with open(local_version_fpath, "w", encoding="utf-8") as f: f.write(f"__version__ = '{__version__}'\n") setup( @@ -52,7 +54,7 @@ package_data={package_name: ["py.typed"]}, include_package_data=True, description=description, - long_description=open("README.md").read(), + long_description=open("README.md", "r", encoding="utf-8").read(), long_description_content_type="text/markdown", author="Pulser Development Team", python_requires=">=3.8", @@ -66,5 +68,5 @@ ) # Restores the original source code of _version.py -with open(local_version_fpath, "w") as f: +with open(local_version_fpath, "w", encoding="utf-8") as f: f.write(stashed_version_source) diff --git a/pulser-simulation/pulser_simulation/_version.py b/pulser-simulation/pulser_simulation/_version.py index 08126f2ae..7b37d81be 100644 --- a/pulser-simulation/pulser_simulation/_version.py +++ b/pulser-simulation/pulser_simulation/_version.py @@ -16,5 +16,5 @@ # Sets the version to the same as 'pulser'. version_file_path = PurePath(__file__).parent.parent.parent / "VERSION.txt" -with open(version_file_path, "r") as f: +with open(version_file_path, "r", encoding="utf-8") as f: __version__ = f.read().strip() diff --git a/pulser-simulation/setup.py b/pulser-simulation/setup.py index 421dffdec..2a85f65c4 100644 --- a/pulser-simulation/setup.py +++ b/pulser-simulation/setup.py @@ -21,23 +21,25 @@ current_directory = Path(__file__).parent # Reads the version from the VERSION.txt file -with open(current_directory.parent / "VERSION.txt", "r") as f: +with open( + current_directory.parent / "VERSION.txt", "r", encoding="utf-8" +) as f: __version__ = f.read().strip() # Changes to the directory where setup.py is os.chdir(current_directory) -with open("requirements.txt") as f: +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" -with open(local_version_fpath, "r") as f: +with open(local_version_fpath, "r", encoding="utf-8") as f: stashed_version_source = f.read() # Overwrites the _version.py for the source distribution (reverted at the end) -with open(local_version_fpath, "w") as f: +with open(local_version_fpath, "w", encoding="utf-8") as f: f.write(f"__version__ = '{__version__}'\n") setup( @@ -48,7 +50,7 @@ package_data={package_name: ["py.typed"]}, include_package_data=True, description="An emulator of pulse-level sequences created with Pulser.", - long_description=open("README.md").read(), + long_description=open("README.md", "r", encoding="utf-8").read(), long_description_content_type="text/markdown", author="Pulser Development Team", python_requires=">=3.8", @@ -62,5 +64,5 @@ ) # Restores the original source code of _version.py -with open(local_version_fpath, "w") as f: +with open(local_version_fpath, "w", encoding="utf-8") as f: f.write(stashed_version_source) diff --git a/setup.py b/setup.py index 25f8faf96..07c53d7b5 100644 --- a/setup.py +++ b/setup.py @@ -15,7 +15,7 @@ from setuptools import setup # Reads the version from the VERSION.txt file -with open("VERSION.txt", "r") as f: +with open("VERSION.txt", "r", encoding="utf-8") as f: __version__ = f.read().strip() if "dev" in __version__: @@ -25,7 +25,7 @@ "`make dev-install` instead." ) -with open("packages.txt", "r") as f: +with open("packages.txt", "r", encoding="utf-8") as f: requirements = [f"{pkg.strip()}=={__version__}" for pkg in f.readlines()] # Just a meta-package that requires all pulser packages @@ -34,7 +34,7 @@ version=__version__, install_requires=requirements, description="A pulse-level composer for neutral-atom quantum devices.", - long_description=open("README.md").read(), + long_description=open("README.md", "r", encoding="utf-8").read(), long_description_content_type="text/markdown", author="Pulser Development Team", python_requires=">=3.8", diff --git a/tests/test_abstract_repr.py b/tests/test_abstract_repr.py index c030ec51b..f02605525 100644 --- a/tests/test_abstract_repr.py +++ b/tests/test_abstract_repr.py @@ -71,7 +71,9 @@ def abstract_device(self, request): @pytest.fixture def device_schema(self): with open( - "pulser-core/pulser/json/abstract_repr/schemas/device-schema.json" + "pulser-core/pulser/json/abstract_repr/schemas/device-schema.json", + "r", + encoding="utf-8", ) as f: dev_schema = json.load(f) return dev_schema @@ -238,7 +240,10 @@ def test_optional_channel_fields(self, ch_obj): def validate_schema(instance): with open( - "pulser-core/pulser/json/abstract_repr/schemas/" "sequence-schema.json" + "pulser-core/pulser/json/abstract_repr/schemas/" + "sequence-schema.json", + "r", + encoding="utf-8", ) as f: schema = json.load(f) jsonschema.validate(instance=instance, schema=schema, registry=REGISTRY)