Skip to content

Commit

Permalink
perf: make site specific dependencies be added to separate group
Browse files Browse the repository at this point in the history
  • Loading branch information
jayanthkoushik committed Jun 28, 2024
1 parent a639092 commit c42ef6d
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 22 deletions.
24 changes: 13 additions & 11 deletions dist/pyseed.py
Original file line number Diff line number Diff line change
Expand Up @@ -871,15 +871,7 @@ def create_project(config: dict[ConfigKey, Any]):
dev_dependencies = ["pre-commit", "ruff", "mypy"]
if not config[ConfigKey.barebones]:
dev_dependencies.extend(
[
"sphinx",
"git+https://github.com/liran-funaro/sphinx-markdown-builder",
"mkdocstrings[python-legacy]",
"mkdocs-material",
"mkdocs-gen-files",
"mkdocs-literate-nav",
"git+https://github.com/jimporter/mike",
]
["sphinx", "git+https://github.com/liran-funaro/sphinx-markdown-builder"]
)
add_dev_deps = [
dep
Expand All @@ -890,6 +882,16 @@ def create_project(config: dict[ConfigKey, Any]):
dev_dependencies.extend(add_dev_deps)
vrun(["poetry", "add", "--group", "dev", *dev_dependencies])

if not config[ConfigKey.barebones]:
site_deps = [
"mkdocstrings[python-legacy]",
"mkdocs-material",
"mkdocs-gen-files",
"mkdocs-literate-nav",
"git+https://github.com/jimporter/mike",
]
vrun(["poetry", "add", "--group", "site", *site_deps])

add_deps = [
dep
for dep_raw in config[ConfigKey.add_deps].split(";")
Expand Down Expand Up @@ -1603,7 +1605,7 @@ def main():
with:
python-version-file: pyproject.toml
cache: poetry
- run: poetry install --all-extras
- run: poetry install --without site --all-extras
- run: SKIP=test poetry run pre-commit run --all-files
- run: ./scripts/verify_pr_commits.py
env:
Expand Down Expand Up @@ -1756,7 +1758,7 @@ def main():
with:
python-version-file: pyproject.toml
cache: poetry
- run: poetry install
- run: poetry install --only site
- name: Configure Git
run: |
git config --global user.name "${{ github.actor }}"
Expand Down
2 changes: 1 addition & 1 deletion src/data/check_pr_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
with:
python-version-file: pyproject.toml
cache: poetry
- run: poetry install --all-extras
- run: poetry install --without site --all-extras
- run: SKIP=test poetry run pre-commit run --all-files
- run: ./scripts/verify_pr_commits.py
env:
Expand Down
2 changes: 1 addition & 1 deletion src/data/deploy_project_site_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
with:
python-version-file: pyproject.toml
cache: poetry
- run: poetry install
- run: poetry install --only site
- name: Configure Git
run: |
git config --global user.name "${{ github.actor }}"
Expand Down
20 changes: 11 additions & 9 deletions src/pyseed.py
Original file line number Diff line number Diff line change
Expand Up @@ -869,15 +869,7 @@ def create_project(config: dict[ConfigKey, Any]):
dev_dependencies = ["pre-commit", "ruff", "mypy"]
if not config[ConfigKey.barebones]:
dev_dependencies.extend(
[
"sphinx",
"git+https://github.com/liran-funaro/sphinx-markdown-builder",
"mkdocstrings[python-legacy]",
"mkdocs-material",
"mkdocs-gen-files",
"mkdocs-literate-nav",
"git+https://github.com/jimporter/mike",
]
["sphinx", "git+https://github.com/liran-funaro/sphinx-markdown-builder"]
)
add_dev_deps = [
dep
Expand All @@ -888,6 +880,16 @@ def create_project(config: dict[ConfigKey, Any]):
dev_dependencies.extend(add_dev_deps)
vrun(["poetry", "add", "--group", "dev", *dev_dependencies])

if not config[ConfigKey.barebones]:
site_deps = [
"mkdocstrings[python-legacy]",
"mkdocs-material",
"mkdocs-gen-files",
"mkdocs-literate-nav",
"git+https://github.com/jimporter/mike",
]
vrun(["poetry", "add", "--group", "site", *site_deps])

add_deps = [
dep
for dep_raw in config[ConfigKey.add_deps].split(";")
Expand Down

0 comments on commit c42ef6d

Please sign in to comment.