diff --git a/.github/workflows/pre-commit-checks.yml b/.github/workflows/pre-commit-checks.yml new file mode 100644 index 0000000..9b85938 --- /dev/null +++ b/.github/workflows/pre-commit-checks.yml @@ -0,0 +1,19 @@ +--- +# used for running pre-commit checks +name: pre-commit checks + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + run_pre_commit_tests: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: "3.10" + - uses: pre-commit/action@v3.0.0 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..14ab7ac --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,23 @@ +# See https://pre-commit.com for more information +# See https://pre-commit.com/hooks.html for more hooks +default_language_version: + python: python3.10 +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.5.0 + hooks: + - id: trailing-whitespace + - id: end-of-file-fixer + - id: check-added-large-files + - repo: https://github.com/codespell-project/codespell + rev: v2.2.6 + hooks: + - id: codespell + - repo: https://github.com/executablebooks/mdformat + rev: 0.7.17 + hooks: + - id: mdformat + - repo: https://github.com/hadolint/hadolint + rev: v2.12.1-beta + hooks: + - id: hadolint diff --git a/README.md b/README.md index 45dfca2..abf0af1 100644 --- a/README.md +++ b/README.md @@ -1 +1 @@ -# test-semver-docker-deploy \ No newline at end of file +# test-semver-docker-deploy diff --git a/build/docker/Dockerfile b/build/docker/Dockerfile new file mode 100644 index 0000000..ef9692d --- /dev/null +++ b/build/docker/Dockerfile @@ -0,0 +1,11 @@ +FROM python:3 + +WORKDIR /usr/src/app + +COPY pyproject.toml poetry.lock ./ + +# hadolint ignore=DL3013 +RUN pip install --no-cache-dir poetry poetry-dynamic-versioning && \ + poetry install + +COPY . . diff --git a/poetry.lock b/poetry.lock new file mode 100644 index 0000000..1c8b73e --- /dev/null +++ b/poetry.lock @@ -0,0 +1,16 @@ +# This file is automatically @generated by Poetry 1.7.1 and should not be changed by hand. + +[[package]] +name = "cowsay" +version = "6.1" +description = "The famous cowsay for GNU/Linux is now available for python" +optional = false +python-versions = ">=3.8" +files = [ + {file = "cowsay-6.1-py3-none-any.whl", hash = "sha256:274b1e6fc1b966d53976333eb90ac94cb07a450a700b455af9fbdf882244b30a"}, +] + +[metadata] +lock-version = "2.0" +python-versions = "^3.9" +content-hash = "ba313313849be1ff1444eb5825f50c3b3e5668b8f5a86e41808ad51ca59f0032" diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..25b382a --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,22 @@ +[tool.poetry] +name = "wintry" +version = "0.0.0" +description = "" +authors = ["d33bs "] +readme = "README.md" +packages = [{include = "src/wintry"}] + +[tool.poetry.dependencies] +python = "^3.9" +cowsay = "^6.1" + +[tool.poetry-dynamic-versioning] +enable = true +style = "pep440" +vcs = "git" + +[build-system] +requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning>=1.0.0,<2.0.0"] +build-backend = "poetry_dynamic_versioning.backend" + +[tool.setuptools_scm] diff --git a/src/wintry/__init__.py b/src/wintry/__init__.py new file mode 100644 index 0000000..3983143 --- /dev/null +++ b/src/wintry/__init__.py @@ -0,0 +1 @@ +from .main import say diff --git a/src/wintry/main.py b/src/wintry/main.py new file mode 100644 index 0000000..c418376 --- /dev/null +++ b/src/wintry/main.py @@ -0,0 +1,4 @@ +def say(words: str) -> None: + import cowsay + + cowsay.cow(words)