Skip to content

Commit 160d87c

Browse files
author
Drew Yang
committed
build: 🎨 pyproject dynamically syncs from version.py | update optional_dependencies
1 parent 076286d commit 160d87c

File tree

3 files changed

+15
-5
lines changed

3 files changed

+15
-5
lines changed

‎.devcontainer/devcontainer.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
// "runServices": [],
2929
// Uncomment the next line if you want to keep your containers running after VS Code shuts down.
3030
"shutdownAction": "stopCompose",
31-
"onCreateCommand": "python3 -m pip install -q -e .[test]",
31+
"onCreateCommand": "python3 -m pip install -q -e .[dev]",
3232
"features": {
3333
"ghcr.io/devcontainers/features/git:1": {},
3434
"ghcr.io/devcontainers/features/docker-in-docker:2": {},

‎docs/src/develop.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Here are some options that provide a great developer experience:
2323
- Ensure you have [Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)
2424
- Ensure you have [Docker](https://docs.docker.com/get-docker/)
2525
- `git clone` the codebase repository and open it in VSCode
26-
- Issue the following command in the terminal to build and run the Docker container: `HOST_UID=$(id -u) PY_VER=3.11 DJ_VERSION=$(grep -oP '\d+\.\d+\.\d+' datajoint/version.py) docker compose --profile test run --rm -it djtest -- sh -c 'pip install -qe ".[test]" && bash'`
26+
- Issue the following command in the terminal to build and run the Docker container: `HOST_UID=$(id -u) PY_VER=3.11 DJ_VERSION=$(grep -oP '\d+\.\d+\.\d+' datajoint/version.py) docker compose --profile test run --rm -it djtest -- sh -c 'pip install -qe ".[dev]" && bash'`
2727
- Issue the following command in the terminal to stop the Docker compose stack: `docker compose --profile test down`
2828

2929
## Features

‎pyproject.toml‎

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[project]
22
name = "datajoint"
3-
# should to be auto synced with datajoint/version.py:__version__
4-
version = "0.14.4"
3+
# dynamically set in tools.setuptools.dynamic
4+
dynamic = ["version"]
55
dependencies = [
66
"numpy",
77
"pymysql>=0.7.2",
@@ -64,11 +64,18 @@ classifiers = [
6464

6565
[project.optional-dependencies]
6666
test = [
67-
"pre-commit",
6867
"pytest",
6968
"pytest-cov",
69+
]
70+
dev = [
71+
"pre-commit",
7072
"black==24.2.0",
7173
"flake8",
74+
"isort",
75+
"codespell",
76+
# including test
77+
"pytest",
78+
"pytest-cov",
7279
]
7380

7481
[project.urls]
@@ -85,6 +92,9 @@ datajoint = "datajoint.cli:cli"
8592
[tool.setuptools]
8693
packages = ["datajoint"]
8794

95+
[tool.setuptools.dynamic]
96+
version = { attr = "datajoint.version.__version__"}
97+
8898
[build-system]
8999
requires = [
90100
"setuptools>=60",

0 commit comments

Comments
 (0)