Skip to content

Commit

Permalink
[Tidy] Add UV as installer, include pip in default env (#658)
Browse files Browse the repository at this point in the history
Co-authored-by: Antony Milne <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Aug 30, 2024
1 parent a305c91 commit 09c85ee
Show file tree
Hide file tree
Showing 4 changed files with 114 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<!--
A new scriv changelog fragment.
Uncomment the section that is right (remove the HTML comment wrapper).
-->

<!--
### Highlights ✨
- A bullet item for the Highlights ✨ category with a link to the relevant PR at the end of your entry, e.g. Enable feature XXX ([#1](https://github.com/mckinsey/vizro/pull/1))
-->
<!--
### Removed
- A bullet item for the Removed category with a link to the relevant PR at the end of your entry, e.g. Enable feature XXX ([#1](https://github.com/mckinsey/vizro/pull/1))
-->
<!--
### Added
- A bullet item for the Added category with a link to the relevant PR at the end of your entry, e.g. Enable feature XXX ([#1](https://github.com/mckinsey/vizro/pull/1))
-->
<!--
### Changed
- A bullet item for the Changed category with a link to the relevant PR at the end of your entry, e.g. Enable feature XXX ([#1](https://github.com/mckinsey/vizro/pull/1))
-->
<!--
### Deprecated
- A bullet item for the Deprecated category with a link to the relevant PR at the end of your entry, e.g. Enable feature XXX ([#1](https://github.com/mckinsey/vizro/pull/1))
-->
<!--
### Fixed
- A bullet item for the Fixed category with a link to the relevant PR at the end of your entry, e.g. Enable feature XXX ([#1](https://github.com/mckinsey/vizro/pull/1))
-->
<!--
### Security
- A bullet item for the Security category with a link to the relevant PR at the end of your entry, e.g. Enable feature XXX ([#1](https://github.com/mckinsey/vizro/pull/1))
-->
9 changes: 8 additions & 1 deletion vizro-ai/hatch.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@
python = ["3.9", "3.10", "3.11", "3.12"]

[envs.changelog]
dependencies = ["scriv"]
dependencies = ["pip", "scriv"]
detached = true
installer = "uv"
scripts = {add = "scriv create --add", collect = ["scriv collect --add", "- hatch run lint:lint --files=CHANGELOG.md"]}

[envs.default]
dependencies = [
"pip",
"devtools[pygments]",
"coverage[toml]>=6.5",
"pytest",
Expand All @@ -24,6 +26,7 @@ dependencies = [
"chromedriver-autoinstaller>=0.6.4",
"urllib3<2.0.0" # helps to resolve bug with urllib3 timeout from vizro-ai integration tests: https://bugs.launchpad.net/python-jenkins/+bug/2018567
]
installer = "uv"

[envs.default.env-vars]
VIZRO_AI_LOG_LEVEL = "DEBUG"
Expand Down Expand Up @@ -51,13 +54,15 @@ test-unit-coverage = [

[envs.docs]
dependencies = [
"pip",
"mkdocs>=1.6",
"mkdocs-material",
"mkdocs-git-revision-date-localized-plugin",
"mkdocstrings[python]",
"linkchecker"
]
detached = true
installer = "uv"

[envs.docs.scripts]
build = "mkdocs build --strict"
Expand All @@ -69,9 +74,11 @@ serve = "mkdocs serve --open"

[envs.lint]
dependencies = [
"pip",
"pre-commit"
]
detached = true
installer = "uv"
scripts = {lint = "SKIP=gitleaks pre-commit run {args:--all-files}"}

[envs.lower-bounds]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<!--
A new scriv changelog fragment.
Uncomment the section that is right (remove the HTML comment wrapper).
-->

<!--
### Highlights ✨
- A bullet item for the Highlights ✨ category with a link to the relevant PR at the end of your entry, e.g. Enable feature XXX ([#1](https://github.com/mckinsey/vizro/pull/1))
-->
<!--
### Removed
- A bullet item for the Removed category with a link to the relevant PR at the end of your entry, e.g. Enable feature XXX ([#1](https://github.com/mckinsey/vizro/pull/1))
-->
<!--
### Added
- A bullet item for the Added category with a link to the relevant PR at the end of your entry, e.g. Enable feature XXX ([#1](https://github.com/mckinsey/vizro/pull/1))
-->
<!--
### Changed
- A bullet item for the Changed category with a link to the relevant PR at the end of your entry, e.g. Enable feature XXX ([#1](https://github.com/mckinsey/vizro/pull/1))
-->
<!--
### Deprecated
- A bullet item for the Deprecated category with a link to the relevant PR at the end of your entry, e.g. Enable feature XXX ([#1](https://github.com/mckinsey/vizro/pull/1))
-->
<!--
### Fixed
- A bullet item for the Fixed category with a link to the relevant PR at the end of your entry, e.g. Enable feature XXX ([#1](https://github.com/mckinsey/vizro/pull/1))
-->
<!--
### Security
- A bullet item for the Security category with a link to the relevant PR at the end of your entry, e.g. Enable feature XXX ([#1](https://github.com/mckinsey/vizro/pull/1))
-->
11 changes: 10 additions & 1 deletion vizro-core/hatch.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@ matrix.python.features = [
]

[envs.changelog]
dependencies = ["scriv"]
dependencies = ["pip", "scriv"]
detached = true
installer = "uv"
scripts = {add = "scriv create --add", collect = ["scriv collect --add", "- hatch run lint:lint --files=CHANGELOG.md"]}

[envs.default]
dependencies = [
"pip",
"devtools[pygments]",
"coverage[toml]>=6.5",
"pytest",
Expand All @@ -29,6 +31,7 @@ dependencies = [
"openpyxl",
"jupyter"
]
installer = "uv"

[envs.default.scripts]
example = "hatch run examples:example {args:scratch_dev}" # shortcut script to underlying example environment script.
Expand Down Expand Up @@ -60,6 +63,7 @@ test-unit-coverage = [

[envs.docs]
dependencies = [
"pip",
"mkdocs>=1.6",
"mkdocs-material",
"mkdocs-git-revision-date-localized-plugin",
Expand All @@ -68,6 +72,7 @@ dependencies = [
"mkdocs-pycafe"
]
detached = true
installer = "uv"

[envs.docs.scripts]
build = "mkdocs build --strict"
Expand All @@ -78,11 +83,13 @@ serve = "mkdocs serve --open"

[envs.examples]
dependencies = [
"pip",
"pyyaml",
# black is required to run the example _visual-vocabulary. This is completely independent of the black used in linting
# our code. When this moves to HuggingFace we can remove the requirement from here.
"black==24.4.2"
]
installer = "uv"
scripts = {example = "cd examples/{args:scratch_dev}; python app.py"}
# This environment doesn't inherit from default but does install Vizro.
template = "examples"
Expand All @@ -93,9 +100,11 @@ VIZRO_LOG_LEVEL = "DEBUG"

[envs.lint]
dependencies = [
"pip",
"pre-commit"
]
detached = true
installer = "uv"
scripts = {lint = "SKIP=gitleaks pre-commit run {args:--all-files}"}

[envs.lower-bounds]
Expand Down

0 comments on commit 09c85ee

Please sign in to comment.