Skip to content

Commit

Permalink
Merge pull request #1252 from qiboteam/optional-deps
Browse files Browse the repository at this point in the history
Introduce pip extras
  • Loading branch information
alecandido committed Mar 8, 2024
2 parents d1fe5a9 + bb1a137 commit bbae1aa
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 40 deletions.
8 changes: 3 additions & 5 deletions .envrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@ if ! has nix_direnv_version || ! nix_direnv_version 2.2.1; then
source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/2.2.1/direnvrc" "sha256-zelF0vLbEl5uaqrfIzbgNzJWGmLzCmYAkInj/LNxvKs="
fi

nix_direnv_watch_file devenv.nix
nix_direnv_watch_file devenv.lock
nix_direnv_watch_file devenv.yaml
if ! use flake . --impure
then
watch_file flake.nix
watch_file flake.lock
if ! use flake . --impure; then
echo "devenv could not be built. The devenv environment was not loaded. Make the necessary changes to devenv.nix and hit enter to try again." >&2
fi
8 changes: 4 additions & 4 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 3 additions & 22 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.05";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
systems.url = "github:nix-systems/default";
devenv.url = "github:cachix/devenv";
nixpkgs-python.url = "github:cachix/nixpkgs-python";
Expand Down Expand Up @@ -35,34 +35,15 @@
{
packages = with pkgs; [
pre-commit
(python3Packages.buildPythonPackage
(let
pname = "poethepoet";
version = "0.24.1";
in {
inherit pname version;
src = fetchPypi {
inherit pname version;
sha256 = "sha256-OvpEtPxzJ98N2RLtoBJgSgcq8rtNJD+w5B6Oyo2r+e0=";
python = "py3";
dist = "py3";
format = "wheel";
};
format = "wheel";
propagatedBuildInputs = [
# Specify dependencies
pkgs.python3Packages.pastel
pkgs.python3Packages.tomli
];
}))
poethepoet
stdenv.cc.cc.lib
];

languages.python = {
enable = true;
poetry = {
enable = true;
install.enable = true;
install.allExtras = true;
install.groups = ["dev"];
};
version = "3.11";
Expand Down
41 changes: 35 additions & 6 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 6 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ cma = "^3.3.0"
joblib = "^1.2.0"
hyperopt = "^0.2.7"
tabulate = "^0.9.0"
openqasm3 = {version = ">=0.5.0", extras = ["parser"]}
openqasm3 = { version = ">=0.5.0", extras = ["parser"] }
numpy = "^1.26.4"
networkx = "^3.2.1"
cvxpy = { version = "^1.4.2", optional = true }
Expand Down Expand Up @@ -98,12 +98,15 @@ cuquantum-python-cu12 = "^23.3.0"
qibojit = { git = "https://github.com/qiboteam/qibojit.git" }
qibotn = { git = "https://github.com/qiboteam/qibotn.git" }

[tool.poetry.extras]
tensorflow = ["tensorflow"]
qinfo = ["cvxpy"]

[tool.pylint.reports]
output-format = "colorized"


[tool.coverage.run]
omit = [ "src/qibo/noise_model.py" ]
omit = ["src/qibo/noise_model.py"]

[tool.pytest.ini_options]
testpaths = ['tests/']
Expand Down

0 comments on commit bbae1aa

Please sign in to comment.