Skip to content

Commit 296b7f6

Browse files
committed
Fix #187 uv ecosystem
1 parent 68c463a commit 296b7f6

19 files changed

+2629
-2114
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,6 @@ venv
1616
MANIFEST
1717
reports
1818
**/RCS/**
19-
.venv
19+
.venv
20+
**.mypy_cache**
21+
uv.lock

Dockerfile.skipper-build

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,18 @@
1-
FROM python:3.11
1+
FROM python:3.12
22

3-
COPY requirements.txt /tmp/requirements.txt
4-
RUN pip install -r /tmp/requirements.txt
3+
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
54

6-
COPY dev-requirements.txt /tmp/dev-requirements.txt
7-
RUN pip install -r /tmp/dev-requirements.txt
5+
ENV VIRTUAL_ENV=/opt/venv
6+
# Add virtual environment bin directory to PATH and link to /usr/local/bin
7+
RUN rm -rf /usr/local/sbin && ln -sf ${VIRTUAL_ENV}/bin /usr/local/sbin
88

9-
RUN rm /tmp/*requirements.txt
9+
ENV PYTHONPATH=${VIRTUAL_ENV}/lib/python3.12/site-packages
10+
ENV UV_LINK_MODE=copy
11+
12+
WORKDIR /tmp
13+
14+
RUN uv venv ${VIRTUAL_ENV} --system --system-site-packages
15+
16+
COPY pyproject.toml pyproject.toml
17+
18+
RUN uv pip install -r pyproject.toml --all-extras

MANIFEST.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
include skipper/data/*
2+
recursive-include skipper/data *

Makefile

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,30 @@
1-
all: pep8 pylint tests build
1+
PACKAGE_NAME := strato_skipper
2+
3+
all: lint tests build
24

35
build:
4-
python setup.py sdist
6+
rm -rf build/$(PACKAGE_NAME)-*.whl
7+
uv build --wheel --out-dir $(PWD)/build/ .
8+
rm -rf dist *.egg-info build/lib build/bdist*
59

6-
pep8:
7-
pep8 skipper tests
10+
lint:
11+
ruff check --preview skipper tests
812

9-
pylint:
10-
mkdir -p reports
11-
PYLINTHOME=reports/ pylint skipper
13+
lint-fix:
14+
ruff check --preview skipper tests --fix
1215

1316
tests:
14-
py.test --cov=skipper --cov-report=term-missing
17+
pytest --cov=skipper --cov-report=term-missing -v tests
1518

1619
install:
17-
pip install -U .
20+
uv pip install -U .
21+
rm -rf dist *.egg-info build/lib build/bdist*
1822

1923
uninstall:
20-
pip uninstall -y strato-skipper
24+
uv pip uninstall -y strato-skipper
2125

2226
clean:
2327
rm -rf build dist *egg-info .tox tests/__pycache__ reports
2428
find -name *.pyc -delete
2529

26-
.PHONY: build pep8 pylint tests install uninstall clean
30+
.PHONY: build lint lint-fix tests install uninstall clean

dev-requirements.txt

Lines changed: 0 additions & 5 deletions
This file was deleted.

pyproject.toml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
[build-system]
2+
requires = [
3+
"setuptools",
4+
"setuptools-git-versioning",
5+
]
6+
build-backend = "setuptools.build_meta"
7+
8+
[tool.setuptools.packages.find]
9+
include = ["skipper*"]
10+
11+
[tool.setuptools-git-versioning]
12+
enabled = true
13+
14+
[tool.distutils.bdist_wheel]
15+
universal = true
16+
17+
[project]
18+
name = "strato-skipper"
19+
dynamic = ["version"]
20+
description = "Easily dockerize your Git repository"
21+
readme = "README.md"
22+
requires-python = ">=3"
23+
license = {text = "Apache-2"}
24+
authors = [
25+
{name = "Adir Gabai", email = "adir@stratoscale.com"}
26+
]
27+
dependencies = [
28+
"PyYAML>=3.11",
29+
"click>=6.7",
30+
"requests>=2.6.0",
31+
"tabulate>=0.7.5",
32+
"six>=1.10.0",
33+
"urllib3>=1.22",
34+
"requests-bearer==0.5.1",
35+
"retry",
36+
"setuptools",
37+
"pbr"
38+
]
39+
40+
[project.optional-dependencies]
41+
dev = [
42+
"pytest",
43+
"pytest-cov",
44+
"ruff",
45+
]
46+
47+
[project.scripts]
48+
skipper = "skipper.main:main"
49+
50+
[tool.pep8]
51+
max-line-length = 145

requirements.txt

Lines changed: 0 additions & 9 deletions
This file was deleted.

ruff.toml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Exclude a variety of commonly ignored directories.
2+
exclude = [
3+
".bzr",
4+
".direnv",
5+
".eggs",
6+
".git",
7+
".hg",
8+
".mypy_cache",
9+
".nox",
10+
".pants.d",
11+
".pytype",
12+
".ruff_cache",
13+
".svn",
14+
".tox",
15+
".venv",
16+
"__pypackages__",
17+
"_build",
18+
"buck-out",
19+
"build",
20+
"dist",
21+
"node_modules",
22+
"venv",
23+
]
24+
25+
# Assume Python 3.11.
26+
target-version = "py311"
27+
28+
# Same as Black.
29+
line-length = 120
30+
31+
[lint]
32+
# Enable pycodestyle (`E`) and Pyflakes (`F`) codes by default.
33+
select = ["E", "F", "W"]
34+
ignore = []
35+
36+
# Allow autofix for all enabled rules (when `--fix`) is provided.
37+
fixable = ["A", "B", "C", "D", "E", "F"]
38+
unfixable = []
39+
40+
# Allow unused variables when underscore-prefixed.
41+
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
42+
43+
pycodestyle.max-line-length = 145

setup.cfg

Lines changed: 0 additions & 23 deletions
This file was deleted.

setup.py

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)