Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,6 @@ venv
MANIFEST
reports
**/RCS/**
.venv
.venv
**.mypy_cache**
uv.lock
21 changes: 15 additions & 6 deletions Dockerfile.skipper-build
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
FROM python:3.11
FROM python:3.12

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

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

RUN rm /tmp/*requirements.txt
ENV PYTHONPATH=${VIRTUAL_ENV}/lib/python3.12/site-packages
ENV UV_LINK_MODE=copy

WORKDIR /tmp

RUN uv venv ${VIRTUAL_ENV} --system --system-site-packages

COPY pyproject.toml pyproject.toml

RUN uv pip install -r pyproject.toml --all-extras
2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
include skipper/data/*
recursive-include skipper/data *
26 changes: 15 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,26 +1,30 @@
all: pep8 pylint tests build
PACKAGE_NAME := strato_skipper

all: lint tests build

build:
python setup.py sdist
rm -rf build/$(PACKAGE_NAME)-*.whl
uv build --wheel --out-dir $(PWD)/build/ .
rm -rf dist *.egg-info build/lib build/bdist*

pep8:
pep8 skipper tests
lint:
ruff check --preview skipper tests

pylint:
mkdir -p reports
PYLINTHOME=reports/ pylint skipper
lint-fix:
ruff check --preview skipper tests --fix

tests:
py.test --cov=skipper --cov-report=term-missing
pytest --cov=skipper --cov-report=term-missing -v tests

install:
pip install -U .
uv pip install -U .
rm -rf dist *.egg-info build/lib build/bdist*

uninstall:
pip uninstall -y strato-skipper
uv pip uninstall -y strato-skipper

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

.PHONY: build pep8 pylint tests install uninstall clean
.PHONY: build lint lint-fix tests install uninstall clean
5 changes: 0 additions & 5 deletions dev-requirements.txt

This file was deleted.

51 changes: 51 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
[build-system]
requires = [
"setuptools",
"setuptools-git-versioning",
]
build-backend = "setuptools.build_meta"

[tool.setuptools.packages.find]
include = ["skipper*"]

[tool.setuptools-git-versioning]
enabled = true

[tool.distutils.bdist_wheel]
universal = true

[project]
name = "strato-skipper"
dynamic = ["version"]
description = "Easily dockerize your Git repository"
readme = "README.md"
requires-python = ">=3"
license = {text = "Apache-2"}
authors = [
{name = "Adir Gabai", email = "[email protected]"}
]
dependencies = [
"PyYAML>=3.11",
"click>=6.7",
"requests>=2.6.0",
"tabulate>=0.7.5",
"six>=1.10.0",
"urllib3>=1.22",
"requests-bearer==0.5.1",
"retry",
"setuptools",
"pbr"
]

[project.optional-dependencies]
dev = [
"pytest",
"pytest-cov",
"ruff",
]

[project.scripts]
skipper = "skipper.main:main"

[tool.pep8]
max-line-length = 145
9 changes: 0 additions & 9 deletions requirements.txt

This file was deleted.

43 changes: 43 additions & 0 deletions ruff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Exclude a variety of commonly ignored directories.
exclude = [
".bzr",
".direnv",
".eggs",
".git",
".hg",
".mypy_cache",
".nox",
".pants.d",
".pytype",
".ruff_cache",
".svn",
".tox",
".venv",
"__pypackages__",
"_build",
"buck-out",
"build",
"dist",
"node_modules",
"venv",
]

# Assume Python 3.11.
target-version = "py311"

# Same as Black.
line-length = 120

[lint]
# Enable pycodestyle (`E`) and Pyflakes (`F`) codes by default.
select = ["E", "F", "W"]
ignore = []

# Allow autofix for all enabled rules (when `--fix`) is provided.
fixable = ["A", "B", "C", "D", "E", "F"]
unfixable = []

# Allow unused variables when underscore-prefixed.
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"

pycodestyle.max-line-length = 145
23 changes: 0 additions & 23 deletions setup.cfg

This file was deleted.

9 changes: 0 additions & 9 deletions setup.py

This file was deleted.

4 changes: 1 addition & 3 deletions skipper/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,7 @@ def fqdn(self):
:return: image Fully Qualified Domain Name
"""
if not self.__fqdn:
self.__fqdn = utils.generate_fqdn_image(
self.registry, self.namespace, self.name, self.tag
)
self.__fqdn = utils.generate_fqdn_image(self.registry, self.namespace, self.name, self.tag)
return self.__fqdn

@property
Expand Down
Loading