-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DX: define developer environment with
uv
(#103)
Co-authored-by: GitHub <[email protected]>
- Loading branch information
Showing
16 changed files
with
78 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,3 +9,6 @@ trim_trailing_whitespace = true | |
|
||
[*.{py,toml}] | ||
indent_size = 4 | ||
|
||
[uv.lock] | ||
indent_size = 4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
layout anaconda | ||
uv sync --all-extras --quiet | ||
source .venv/bin/activate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,5 @@ | |
.eggs/ | ||
|
||
# Temporary files | ||
condaenv.*.requirements.txt | ||
node_modules/ | ||
uv.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
3.12 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,26 @@ | ||
# Help developing | ||
# How to contribute? | ||
|
||
## Local set-up | ||
[![Open in Visual Studio Code](https://img.shields.io/badge/vscode-open-blue?logo=visualstudiocode)](https://github.dev/ComPWA/actions) | ||
|
||
Please install `pre-commit`, for example [through Conda](https://anaconda.org/conda-forge/pre_commit). For more information, see [Help developing](https://compwa.github.io/develop) on [compwa.github.io](https://compwa.github.io). | ||
> [!TIP] | ||
> This package is part of the [ComPWA Organization](https://github.com/ComPWA). For more information about how to contribute to the packages, go to **[compwa.github.io/develop](https://compwa.github.io/develop)**! | ||
## Conventions | ||
To contribute to the project, you need to install the package in a virtual environment. This can be done best with [`uv`](https://docs.astral.sh/uv) (see installation instructions [here](https://docs.astral.sh/uv/getting-started/installation)). For this, you first need to get the source code with [Git](https://git-scm.com): | ||
|
||
- It is assumed that repositories that use shared workflows from this repository can run their CI jobs locally with [`tox`](https://tox.wiki). Names of the workflow files should therefore be the same as the name of the corresponding `tox` job. For example, a common job is `docnb`, which builds HTML pages with [Sphinx](https://www.sphinx-doc.org) using the [`myst-nb`](https://myst-nb.rtfd.io) extension. The corresponding job file for this job is [`docnb.yml`](./.github/workflows/docnb.yml). | ||
- Workflow definitions are located under [`.github/workflows`](./.github/workflows/): GitHub Actions [does not yet support sharing workflows in subdirectories](https://docs.github.com/en/actions/using-workflows/reusing-workflows#creating-a-reusable-workflow). | ||
- Actions are located under directories in the root folder, for example [`pip-install/action.yml`](./pip-install/action.yml). | ||
```shell | ||
git clone https://github.com/ComPWA/actions | ||
cd actions | ||
``` | ||
|
||
Now it's simply a matter of creating and activating the [virtual environment](https://docs.astral.sh/uv/pip/environments) with [`uv sync`](https://docs.astral.sh/uv/reference/cli/#uv-sync). The dependencies for the project are 'pinned' in each commit through the [`uv.lock` file](https://docs.astral.sh/uv/concepts/projects/#project-lockfile). | ||
|
||
```shell | ||
uv sync | ||
source .venv/bin/activate | ||
``` | ||
|
||
Formatting and linting checks are automatically performed when committing changes. This is done with [pre-commit](https://pre-commit.com). To install the hooks in your local repository, run [`pre-commit install`](https://pre-commit.com/#3-install-the-git-hook-scripts) **once**: | ||
|
||
```shell | ||
pre-commit install --install-hooks | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,14 +4,6 @@ requires = ["setuptools>=61.2"] | |
|
||
[project] | ||
authors = [{name = "Common Partial Wave Analysis", email = "[email protected]"}] | ||
classifiers = [ | ||
"Development Status :: 4 - Beta", | ||
"Intended Audience :: Developers", | ||
"Natural Language :: English", | ||
"Operating System :: OS Independent", | ||
"Programming Language :: Python :: 3.12", | ||
"Programming Language :: Python", | ||
] | ||
dependencies = ["packaging"] | ||
description = "Python scripts used by the ComPWA/actions repository" | ||
dynamic = ["version"] | ||
|
@@ -24,7 +16,7 @@ dev = [ | |
"compwa-actions[sty]", | ||
] | ||
sty = [ | ||
"pre-commit", | ||
"pre-commit-uv", | ||
"ruff", | ||
] | ||
|
||
|
@@ -37,6 +29,9 @@ include-package-data = false | |
license-files = ["LICENSE"] | ||
|
||
[tool.pyright] | ||
exclude = [ | ||
"**/.venv/", | ||
] | ||
reportMissingTypeArgument = false | ||
reportUnknownArgumentType = false | ||
reportUnknownMemberType = false | ||
|
@@ -47,7 +42,6 @@ typeCheckingMode = "strict" | |
[tool.ruff] | ||
preview = true | ||
show-fixes = true | ||
target-version = "py312" | ||
|
||
[tool.ruff.format] | ||
docstring-code-format = true | ||
|
@@ -100,6 +94,5 @@ sort_first = [ | |
"tool.setuptools", | ||
"tool.setuptools_scm", | ||
] | ||
sort_table_keys = true | ||
spaces_indent_inline_array = 4 | ||
trailing_comma_inline_array = true |