Skip to content

Commit 14cb0a4

Browse files
authored
Move pyproject.toml to root level dir (#980)
2 parents 4d5b597 + 3ac96e6 commit 14cb0a4

File tree

10 files changed

+72
-1199
lines changed

10 files changed

+72
-1199
lines changed

.github/dependabot.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ updates:
88
- package-ecosystem: "uv" # See documentation for possible values
99
directories:
1010
- "/"
11-
- "/src" # Location of package manifests
1211
schedule:
1312
interval: "weekly"
1413
groups:

.github/workflows/deploy_site.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,15 @@ jobs:
4343
run: |
4444
python -m pip install --upgrade pip
4545
python -m pip install uv
46-
uv sync --project=src --no-dev
46+
uv sync --no-dev
4747
4848
- name: Setup Pages
4949
uses: actions/configure-pages@v5
5050

5151
- name: Build Site
5252
run: |
5353
export PYTHONPATH=src:$PYTHONPATH
54-
uv run --project=src mkdocs build --clean --config-file mkdocs.yml
54+
uv run mkdocs build --clean --config-file mkdocs.yml
5555
5656
- name: Upload artifact
5757
uses: actions/upload-pages-artifact@v4

.github/workflows/link_checker.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ on:
1111
# run on any PR that changes this workflow
1212
- .github/workflows/linkchecker.yml
1313
# run on any PR that changes the pip requirements
14-
- requirements.txt
15-
- src/pyproject.toml
14+
- pyproject.toml
1615
# let us trigger it manually
1716
workflow_dispatch:
1817

@@ -31,13 +30,13 @@ jobs:
3130
- name: Install dependencies
3231
run: |
3332
python -m pip install --upgrade pip uv
34-
uv sync --dev --project=src
33+
uv sync --dev
3534
3635
- name: Build Site
3736
run: |
38-
uv run --project=src mkdocs build --verbose --clean --config-file mkdocs.yml
37+
uv run mkdocs build --verbose --clean --config-file mkdocs.yml
3938
4039
- name: Check links
4140
run: |
42-
uv run --project=src linkchecker site/index.html
41+
uv run linkchecker site/index.html
4342

.github/workflows/python-app.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@ jobs:
2828
- name: Install dependencies
2929
run: |
3030
python -m pip install --upgrade pip uv
31-
uv sync --project=src --dev --frozen
31+
uv sync --dev --frozen
3232
# - uses: psf/black@stable
3333
- name: Test with pytest
3434
run: |
35-
uv run --project=src pytest
35+
uv run pytest
3636
- name: Build
3737
run: |
38-
uv build --project=src
38+
uv build
3939
- name: Upload Artifacts
4040
uses: actions/upload-artifact@v4
4141
with:

Makefile

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
# Project-specific vars
22
MKDOCS_PORT=8765
33
DOCKER_DIR=docker
4-
PROJECT_DIR = ./src
54
DOCKER_COMPOSE=docker-compose --project-directory $(DOCKER_DIR)
6-
UV_RUN=uv run --project $(PROJECT_DIR)
5+
UV_RUN=uv run
76

87
# Targets
98
.PHONY: all test docs api docker_test clean help mdlint_fix up down regenerate_json
@@ -13,15 +12,15 @@ all: help
1312

1413
dev:
1514
@echo "Set up dev environment..."
16-
uv sync --dev --project $(PROJECT_DIR)
15+
uv sync --dev
1716

1817
mdlint_fix:
1918
@echo "Running markdownlint..."
2019
markdownlint --config .markdownlint.yml --fix .
2120

2221
test:
2322
@echo "Running tests locally..."
24-
uv run --project $(PROJECT_DIR) pytest -v
23+
$(UV_RUN) pytest -v
2524

2625
docker_test:
2726
@echo "Building the latest test image..."
@@ -60,7 +59,7 @@ regenerate_json:
6059
clean:
6160
@echo "Cleaning up Docker resources..."
6261
$(DOCKER_COMPOSE) down --rmi local || true
63-
rm -rf $(PROJECT_DIR)/.venv $(PROJECT_DIR)/uv.lock
62+
6463
help:
6564
@echo "Usage: make [target]"
6665
@echo ""

docker/Dockerfile

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,35 +3,26 @@ RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /
33
RUN pip install --upgrade pip uv
44
WORKDIR /app
55

6-
ENV VIRTUAL_ENV=/app/.venv
7-
ENV PATH="${VIRTUAL_ENV}/bin:${PATH}"
8-
9-
RUN python -m venv "${VIRTUAL_ENV}"
106
FROM base AS dependencies
117

12-
ARG BASE_DIR=..
13-
ARG SRC_DIR=${BASE_DIR}/src
14-
158
# Copy the files we need
16-
COPY ${BASE_DIR}/ /app
9+
COPY . /app
1710
# Set the environment variable
1811
ENV PYTHONPATH=/app/src
19-
COPY ${SRC_DIR}/pyproject.toml /app/src/pyproject.toml
20-
COPY ${SRC_DIR}/uv.lock /app/src/uv.lock
2112

2213
# install requirements
23-
RUN uv sync --project=/app/src --frozen
24-
14+
RUN uv sync --frozen
2515

2616
FROM dependencies AS test
17+
2718
ENV PYTHONPATH=/app/src
2819
# Install pytest and dev dependencies
29-
RUN uv sync --project=/app/src --frozen --dev
20+
RUN uv sync --frozen --dev
3021
# Run the unit tests
31-
CMD ["uv", "run", "--project=/app/src", "pytest"]
22+
CMD ["uv", "run", "pytest"]
3223

3324
FROM dependencies AS docs
34-
CMD ["uv", "run", "--project=/app/src", "mkdocs", "serve", "--dev-addr", "0.0.0.0:8000"]
25+
CMD ["uv", "run", "mkdocs", "serve", "--dev-addr", "0.0.0.0:8000"]
3526

3627
FROM dependencies AS registry_api
37-
CMD ["uv", "run", "--project=/app/src", "uvicorn", "ssvc.api.main:app", "--host", "0.0.0.0", "--port", "8000"]
28+
CMD ["uv", "run", "uvicorn", "ssvc.api.main:app", "--host", "0.0.0.0", "--port", "8000"]

docker/env_example

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# copy or link this file to .env in this directory
2+
# this helps avoid docker image/container naming collisions
3+
COMPOSE_PROJECT_NAME=ssvc

src/pyproject.toml renamed to pyproject.toml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ exclude = ["test*"] # exclude packages matching these glob patterns (empty by d
6767
#namespaces = false # to disable scanning PEP 420 namespaces (true by default)
6868

6969
[tool.setuptools_scm]
70-
version_file = "ssvc/_version.py"
71-
root = ".."
70+
version_file = "./src/ssvc/_version.py"
71+
root = "."
7272
local_scheme = "no-local-version"
7373
version_scheme = "no-guess-dev"
7474

@@ -77,7 +77,7 @@ version_scheme = "no-guess-dev"
7777

7878
[tool.black]
7979
line-length = 79
80-
target-version = ['py38', 'py39', 'py310', 'py311']
80+
target-version = ['py38', 'py39', 'py310', 'py311', 'py312', 'py313']
8181

8282
[tool.pytest.ini_options]
8383
minversion = "6.0"
@@ -88,6 +88,7 @@ testpaths = [
8888

8989
[dependency-groups]
9090
dev = [
91+
"black>=25.9.0",
9192
"linkchecker>=10.6.0",
9293
"pytest>=8.4.1",
9394
]

0 commit comments

Comments
 (0)