diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 534e613..93336e5 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -35,9 +35,7 @@ jobs: python-version: ${{ matrix.python-version }} - name: Install dependencies run: | - pip install tox juliacall - pip install -e . # to put juliapkg.json in sys.path - python -c 'import juliacall' # force install of all deps + pip install tox - name: Run Tests run: | tox -e unit-tests diff --git a/pyproject.toml b/pyproject.toml index ce25767..190197c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -19,42 +19,19 @@ classifiers = [ "Programming Language :: Python :: 3.11", "Operating System :: OS Independent" ] -dynamic = ["version", "dependencies"] +dynamic = ["version", "dependencies", "optional-dependencies"] [project.entry-points."braket.simulators"] braket_sv_v2 = "braket.simulator_v2.state_vector_simulator_v2:StateVectorSimulatorV2" braket_dm_v2 = "braket.simulator_v2.density_matrix_simulator_v2:DensityMatrixSimulatorV2" -[project.optional-dependencies] -test = [ - "amazon-braket-pennylane-plugin", - "black", - "flake8", - "flake8-rst-docstrings", - "isort", - "pre-commit", - "pylint", - "pytest==7.1.2", - "pytest-benchmark", - "pytest-cov", - "pytest-rerunfailures", - "pytest-timeout", - "pytest-xdist", - "qiskit==1.1.2", - "qiskit-braket-provider==0.4.1", - "qiskit-algorithms", - "sphinx", - "sphinx-rtd-theme", - "sphinxcontrib-apidoc", - "tox" -] - [tool.setuptools] include-package-data=false package-data = {"*" = ["*.json"]} [tool.setuptools.dynamic] dependencies = {file = "requirements.txt"} +optional-dependencies.test = { file = "requirements-test.txt" } [tool.isort] profile = "black" diff --git a/requirements-test.txt b/requirements-test.txt new file mode 100644 index 0000000..5e32098 --- /dev/null +++ b/requirements-test.txt @@ -0,0 +1,20 @@ +amazon-braket-pennylane-plugin +black +flake8 +flake8-rst-docstrings +isort +pre-commit +pylint +pytest==7.1.2 +pytest-benchmark +pytest-cov +pytest-rerunfailures +pytest-timeout +pytest-xdist +qiskit==1.2.0 +qiskit-braket-provider==0.4.1 +qiskit-algorithms +sphinx +sphinx-rtd-theme +sphinxcontrib-apidoc +tox diff --git a/setup.cfg b/setup.cfg index 2124d8b..853c49e 100644 --- a/setup.cfg +++ b/setup.cfg @@ -4,7 +4,7 @@ test=pytest [tool:pytest] xfail_strict = true addopts = - --verbose -n auto + --verbose -n auto --durations=0 --durations-min=1 --dist worksteal testpaths = test/unit_tests [flake8] diff --git a/src/braket/simulator_v2/julia_import.py b/src/braket/simulator_v2/julia_import.py index bc09f09..74ea565 100644 --- a/src/braket/simulator_v2/julia_import.py +++ b/src/braket/simulator_v2/julia_import.py @@ -64,7 +64,6 @@ def setup_julia(): jl.BraketSimulator.simulate._jl_call_nogil(dm, irs, input_dict, 0) # don't waste time looking for packages # which should already be present after this - os.environ["PYTHON_JULIAPKG_OFFLINE"] = "no" del sv del dm del stock_oq3 diff --git a/tox.ini b/tox.ini index de6b055..46576b8 100644 --- a/tox.ini +++ b/tox.ini @@ -10,7 +10,9 @@ allowlist_externals = pytest setenv = PYTHON_JULIACALL_HANDLE_SIGNALS=yes + PYTHON_JULIACALL_OPTIMIZE=0 commands = + python -c 'import juliacall' # force install of all deps pytest {posargs} --cov-report term-missing --cov-report html --cov-report xml --cov=braket extras = test