diff --git a/.github/workflows/backwards_compatibility.yml b/.github/workflows/backwards_compatibility.yml index 4c0fda4312..92ac50ff8a 100644 --- a/.github/workflows/backwards_compatibility.yml +++ b/.github/workflows/backwards_compatibility.yml @@ -67,7 +67,7 @@ jobs: .\.venv\Scripts\Activate.ps1 python -m pip install --upgrade pip pip install --upgrade build wheel - pip install .[tests] + pip install . --group tests - name: Login to GitHub Container Registry uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0 @@ -189,7 +189,7 @@ jobs: run: | python -m pip install --upgrade pip pip install --upgrade build wheel - pip install -e .[tests] + pip install -e . --group tests - name: Download Geometry service container (if needed) env: diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index 6333468582..2d87825ed3 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -228,7 +228,7 @@ jobs: run: | python -m pip install --upgrade pip pip install --upgrade build wheel - pip install -e .[tests] + pip install -e . --group tests - name: Login to GitHub Container Registry if: env.SKIP_UNSTABLE == 'false' @@ -349,6 +349,7 @@ jobs: needs-quarto: true dependencies: 'pandoc' sphinxopts: '-j 1 -W --color' + group-dependencies-name: "doc" - name: Stop the Geometry service if: always() @@ -446,6 +447,7 @@ jobs: python-version: ${{ env.MAIN_PYTHON_VERSION }} checkout: false randomize: true + group-dependencies-name: "tests" - name: Upload coverage to Codecov uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5.5.1 @@ -515,8 +517,7 @@ jobs: - name: Install minimum requirements run: | python -m pip install --upgrade pip - pip install -e .[all,tests-minimal] - pip install pytest + pip install -e .[all] --group tests-minimal - name: Start Geometry service and verify start env: @@ -568,7 +569,7 @@ jobs: - name: Install minimum requirements run: | python -m pip install --upgrade pip - pip install -e .[tests-minimal] + pip install -e . --group tests-minimal # Uninstall pytest-pyvista (not needed for these tests) pip uninstall -y pytest-pyvista # Installing docker (needed for the tests) @@ -741,7 +742,7 @@ jobs: python -m venv .venv .\.venv\Scripts\Activate.ps1 python -m pip install --upgrade pip - pip install -e .[tests] + pip install -e . --group tests - name: Restore images cache uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 @@ -842,7 +843,7 @@ jobs: - name: Validate connection using PyAnsys Geometry run: | python -m pip install --upgrade pip - pip install -e .[tests] + pip install -e . --group tests - name: Start Geometry service and verify start env: @@ -868,6 +869,7 @@ jobs: pytest-extra-args: "--use-existing-service=yes" checkout: false randomize: true + group-dependencies-name: "tests" - name: "Compressing Linux Dockerfile" uses: vimtor/action-zip@1379ea20d4c5705669ba81fd626dd01b1c738f26 # v1.2 diff --git a/.github/workflows/nightly_docker_test.yml b/.github/workflows/nightly_docker_test.yml index 2adc61f7e2..9c97ee1787 100644 --- a/.github/workflows/nightly_docker_test.yml +++ b/.github/workflows/nightly_docker_test.yml @@ -115,7 +115,7 @@ jobs: - name: Install packages for testing run: | pip install --upgrade build - pip install -e .[tests] + pip install -e . --group tests - name: Login to GitHub Container Registry uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0 @@ -214,6 +214,7 @@ jobs: ALLOW_PLOTTING: true with: python-version: ${{ env.MAIN_PYTHON_VERSION }} + group-dependencies-name: "tests" - name: Stop the Geometry service if: always() diff --git a/doc/changelog.d/2316.maintenance.md b/doc/changelog.d/2316.maintenance.md new file mode 100644 index 0000000000..64e11953a6 --- /dev/null +++ b/doc/changelog.d/2316.maintenance.md @@ -0,0 +1 @@ +Using group dependencies diff --git a/doc/source/contributing.rst b/doc/source/contributing.rst index 7eabd2e756..69d778dc21 100644 --- a/doc/source/contributing.rst +++ b/doc/source/contributing.rst @@ -19,7 +19,7 @@ these commands: git clone https://github.com/ansys/pyansys-geometry cd pyansys-geometry python -m pip install --upgrade pip - pip install -e . + pip install -e . --group dev Post issues @@ -106,7 +106,7 @@ Build the documentation To build the documentation locally, you must run this command to install the documentation dependencies:: - pip install -e .[doc] + pip install -e . --group doc Then, navigate to the ``docs`` directory and run this command:: @@ -149,7 +149,7 @@ You can also test the correct build process of a new example by performing the f 1. Run the following command to install the documentation dependencies:: - pip install -e .[doc] + pip install -e . --group doc 2. Navigate to the ``doc`` directory and run the following command:: @@ -177,7 +177,7 @@ Prerequisites Prior to running the tests, you must run this command to install the test dependencies:: - pip install -e .[tests] + pip install -e . --group tests Make sure to define the port and host of the service using the following environment variables:: diff --git a/pyproject.toml b/pyproject.toml index 2636df665c..815bdc30d3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -41,7 +41,6 @@ dependencies = [ "semver>=3,<4", "six>=1.16.0,<2", ] - optional-dependencies.all = [ "ansys-platform-instancemanagement>=1.0.3,<2", "ansys-tools-visualization-interface>=0.2.6", @@ -50,50 +49,53 @@ optional-dependencies.all = [ "pyvista[jupyter]>=0.38.1,<1", "vtk>=9,<10", ] -optional-dependencies.doc = [ +optional-dependencies.graphics = [ + "ansys-tools-visualization-interface>=0.2.6", + "pygltflib>=1.16,<2", + "pyvista[jupyter]>=0.38.1,<1", + "vtk>=9,<10", +] + +urls.Changelog = "https://github.com/ansys/pyansys-geometry/blob/main/doc/source/changelog.rst" +urls.Discussions = "https://github.com/ansys/pyansys-geometry/discussions" +urls.Documentation = "https://geometry.docs.pyansys.com" +urls.Issues = "https://github.com/ansys/pyansys-geometry/issues" +urls.Releases = "https://github.com/ansys/pyansys-geometry/releases" +urls.Source = "https://github.com/ansys/pyansys-geometry" + +[dependency-groups] + +# NOTE: The `dependency-groups` section is used to define groups of dependencies +# only available when a developer clones the repository and installs the package +# for local development. +dev = [ + "pre-commit==4.3.0", + { include-group = "doc" }, + { include-group = "tests" }, +] +doc = [ "ansys-sphinx-theme[autoapi]==1.6.3", - "ansys-tools-path==0.7.3", - "ansys-tools-visualization-interface==0.12.1", - "beartype==0.21.0", - "docker==7.1.0", - "geomdl==5.4.0", - "grpcio==1.75.0", - "grpcio-health-checking==1.75.0", "ipyvtklink==0.2.3", "jupyter-sphinx==0.5.3", "jupytext==1.17.3", - "matplotlib==3.10.6", "myst-parser==4.0.1", "nbconvert==7.16.6", "nbsphinx==0.9.6", "notebook==7.4.7", - "numpy==2.2.6", "numpydoc==1.9.0", - "panel==1.8.2", "pdf2image==1.17.0", - "pint==0.24.4", - "protobuf==6.32.1", - "pygltflib==1.16.5", - "pyvista[jupyter]==0.46.3", "quarto-cli==1.8.25", - "requests==2.32.5", - "scipy==1.15.3", - "semver==3.0.4", - "six==1.17.0", "sphinx==8.2.3", "sphinx-autodoc-typehints==3.1.0", "sphinx-copybutton==0.5.2", "sphinx-jinja==2.0.2", - "trame-vtk==2.10.0", - "vtk==9.5.2", + { include-group = "general-all" }, ] -optional-dependencies.graphics = [ - "ansys-tools-visualization-interface>=0.2.6", - "pygltflib>=1.16,<2", - "pyvista[jupyter]>=0.38.1,<1", - "vtk>=9,<10", +tests = [ + { include-group = "general-all" }, + { include-group = "tests-minimal" }, ] -optional-dependencies.tests = [ +general-all = [ "ansys-platform-instancemanagement==1.1.2", "ansys-tools-path==0.7.3", "ansys-tools-visualization-interface==0.12.1", @@ -107,29 +109,19 @@ optional-dependencies.tests = [ "pint==0.24.4", "protobuf==6.32.1", "pygltflib==1.16.5", - "pytest==8.4.2", - "pytest-cov==7.0.0", - "pytest-pyvista==0.2.0", "pyvista[jupyter]==0.46.3", - "pyyaml==6.0.3", "requests==2.32.5", "scipy==1.15.3", "semver==3.0.4", "six==1.17.0", "vtk==9.5.2", ] -optional-dependencies.tests-minimal = [ +tests-minimal = [ "pytest==8.4.2", "pytest-cov==7.0.0", "pytest-pyvista==0.2.0", "pyyaml==6.0.3", ] -urls.Changelog = "https://github.com/ansys/pyansys-geometry/blob/main/doc/source/changelog.rst" -urls.Discussions = "https://github.com/ansys/pyansys-geometry/discussions" -urls.Documentation = "https://geometry.docs.pyansys.com" -urls.Issues = "https://github.com/ansys/pyansys-geometry/issues" -urls.Releases = "https://github.com/ansys/pyansys-geometry/releases" -urls.Source = "https://github.com/ansys/pyansys-geometry" [tool.flit.module] name = "ansys.geometry.core"