Skip to content

Commit

Permalink
feat: protecting deps installed on upper limits (#924)
Browse files Browse the repository at this point in the history
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
RobPasMue and pre-commit-ci[bot] authored Jan 15, 2024
1 parent 21e8cfd commit 287cf5d
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 20 deletions.
16 changes: 11 additions & 5 deletions doc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,31 @@ help:

.PHONY: help Makefile

.install-deps:
@pip freeze | grep -q "sphinx-autoapi @ git+https://github.com/ansys/sphinx-autoapi" && is_custom_sphinx_autoapi_installed="yes" || is_custom_sphinx_autoapi_installed="no"
@if [ "$$is_custom_sphinx_autoapi_installed" != "yes" ]; then \
pip uninstall --yes sphinx-autoapi; \
pip install "sphinx-autoapi @ git+https://github.com/ansys/sphinx-autoapi@feat/single-page-stable"; \
fi

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
%: .install-deps Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)


# Customized clean due to examples gallery
clean:
clean: .install-deps
rm -rf $(BUILDDIR)/*
find . -type d -name "api" -exec rm -rf {} +

# Create PDF
pdf:
pdf: .install-deps
@$(SPHINXBUILD) -M latex "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
cd $(BUILDDIR)/latex && latexmk -r latexmkrc -pdf *.tex -interaction=nonstopmode || true
(test -f $(BUILDDIR)/latex/*.pdf && echo pdf exists) || exit 1

# Build HTML files and generate examples as .py files
html:
html: .install-deps
@$(SPHINXBUILD) -M linkcheck "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
@$(SPHINXBUILD) -M html "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
cd $(BUILDDIR)/html/examples
Expand Down
30 changes: 15 additions & 15 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,25 +25,25 @@ classifiers = [

dependencies = [
"ansys-api-geometry==0.3.5",
"ansys-tools-path>=0.3",
"beartype>=0.11.0",
"google-api-python-client>=1.7.11",
"googleapis-common-protos>=1.52.0",
"grpcio>=1.35.0",
"grpcio-health-checking>=1.45.0",
"numpy>=1.20.3",
"Pint>=0.18",
"protobuf>=3.20.2",
"pyvista>=0.37.0",
"scipy>=1.7.3",
"six>=1.16.0",
"vtk>=9",
"ansys-tools-path>=0.3,<1",
"beartype>=0.11.0,<1",
"google-api-python-client>=1.7.11,<3",
"googleapis-common-protos>=1.52.0,<2",
"grpcio>=1.35.0,<2",
"grpcio-health-checking>=1.45.0,<2",
"numpy>=1.20.3,<2",
"Pint>=0.18,<1",
"protobuf>=3.20.2,<5",
"pyvista>=0.37.0,<1",
"scipy>=1.7.3,<2",
"six>=1.16.0,<2",
"vtk>=9,<10",
]

[project.optional-dependencies]
all = [
"ansys-platform-instancemanagement>=1.0.3",
"docker>=6.0.1",
"ansys-platform-instancemanagement>=1.0.3,<2",
"docker>=6.0.1,<8",
"pyvista[trame]>=0.38.1,<0.42",
]
tests = [
Expand Down

0 comments on commit 287cf5d

Please sign in to comment.