Skip to content

Commit

Permalink
fixing version location
Browse files Browse the repository at this point in the history
  • Loading branch information
krneta committed Apr 24, 2024
1 parent ff77a54 commit 4af7d4f
Show file tree
Hide file tree
Showing 12 changed files with 12 additions and 59 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ __pycache__/
*.ipynb_checkpoints/
pip-wheel-metadata/

coverage.xml
/.coverage
/.coverage.*
/.cache
Expand Down
3 changes: 0 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ build-backend = "setuptools.build_meta"
[project]
name = "amazon-braket-simulator-v2"
version = "0.0.1"
authors = [
{name = "Katharine Hyatt", email = "hyatkath@amazon.com"},
]
description = "Local simulation of quantum circuits"
readme = {file = "README.md", content-type = "text/markdown"}
license = {file = "LICENSE"}
Expand Down
29 changes: 3 additions & 26 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,32 +1,9 @@
import os

from setuptools import setup

if os.path.exists(".git"):
kwargs = {
"use_scm_version": {
"write_to": "src/braket/version.py",
},
"setup_requires": ["setuptools", "setuptools_scm"],
}
else:
# Read from pyproject.toml directly
import re

with open(os.path.join(os.path.dirname(__file__), "pyproject.toml")) as f:
data = f.read()
# Find the version
version = re.search(r'version = "(.*)"', data).group(1)

# Write the version to version.py
with open(
os.path.join(os.path.dirname(__file__), "src", "braket", "version.py"),
"w",
) as f:
f.write(f'__version__ = "{version}"')

kwargs = {"version": version}
with open("src/braket/simulator_v2/_version.py") as f:
version = f.readlines()[-1].split()[-1].strip("\"'")

kwargs = {"version": version}

# Build options are managed in pyproject.toml
setup(**kwargs)
3 changes: 1 addition & 2 deletions src/braket/simulator_v2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
StateVectorSimulatorV2,
)

# This file is created by setuptools_scm during the build process:
from .version import __version__
from ._version import __version__ # noqa: F401

__all__ = [
"jl",
Expand Down
File renamed without changes.
16 changes: 0 additions & 16 deletions src/braket/version.py

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
from typing import Any, Dict, Union

import numpy as np

from braket.aws import AwsDevice
from braket.circuits import Circuit, Gate, Instruction, Observable, ResultType
from braket.circuits.quantum_operator_helpers import get_pauli_eigenvalues
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# language governing permissions and limitations under the License.

import pytest
from braket.devices import LocalSimulator
from gate_model_device_testing_utils import (
multithreaded_bell_pair_testing,
no_result_types_bell_pair_testing,
Expand All @@ -34,8 +35,6 @@
result_types_zero_shots_bell_pair_testing,
)

from braket.devices import LocalSimulator

DEVICE = LocalSimulator("braket_sv_v2")
SHOTS = 8000

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# language governing permissions and limitations under the License.

import pytest
from braket.devices import LocalSimulator
from gate_model_device_testing_utils import (
no_result_types_bell_pair_testing,
noisy_circuit_1qubit_noise_full_probability,
Expand All @@ -33,8 +34,6 @@
result_types_tensor_z_z_testing,
)

from braket.devices import LocalSimulator

DEVICE = LocalSimulator("braket_dm_v2")
SHOTS = 8000

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@

import numpy as np
import pytest

from braket.device_schema.simulators import (
GateModelSimulatorDeviceCapabilities,
GateModelSimulatorDeviceParameters,
)
from braket.ir.jaqcd import Expectation
from braket.ir.jaqcd import Program as JaqcdProgram
from braket.ir.openqasm import Program as OpenQASMProgram
from braket.simulator_v2 import DensityMatrixSimulatorV2 as DensityMatrixSimulator
from braket.task_result import AdditionalMetadata, TaskMetadata

from braket.simulator_v2 import DensityMatrixSimulatorV2 as DensityMatrixSimulator

CircuitData = namedtuple("CircuitData", "circuit_ir probability_zero")


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

import numpy as np
import pytest

from braket.default_simulator import observables
from braket.device_schema.simulators import (
GateModelSimulatorDeviceCapabilities,
Expand All @@ -31,9 +30,10 @@
from braket.ir.jaqcd import Program as JaqcdProgram
from braket.ir.jaqcd import StateVector, Variance
from braket.ir.openqasm import Program as OpenQASMProgram
from braket.simulator_v2 import StateVectorSimulatorV2 as StateVectorSimulator
from braket.task_result import AdditionalMetadata, TaskMetadata

from braket.simulator_v2 import StateVectorSimulatorV2 as StateVectorSimulator

CircuitData = namedtuple("CircuitData", "circuit_ir probability_zero")


Expand Down
4 changes: 1 addition & 3 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = linters,docs,unit-tests,integ-tests
envlist = linters,docs,unit-tests

[testenv:unit-tests]
basepython = python3
Expand All @@ -12,7 +12,6 @@ deps =
allowlist_externals =
pytest
commands =
python julia_private_repo_setup/setup_private_repos.py
pytest {posargs} --cov-report term-missing --cov-report html --cov-report xml --cov=braket
extras = test

Expand All @@ -27,7 +26,6 @@ deps =
allowlist_externals =
pytest
commands =
python julia_private_repo_setup/setup_private_repos.py
pytest {posargs} --cov-report term-missing --cov-report html --cov-report xml --cov=braket
extras = test

Expand Down

0 comments on commit 4af7d4f

Please sign in to comment.