From 7cd64437f478a0ad94b3da5be91b6051994827ec Mon Sep 17 00:00:00 2001 From: Val Lorentz Date: Wed, 14 Sep 2022 17:20:51 +0200 Subject: [PATCH 1/5] Initialize with CI --- .woodpecker.yml | 33 +++++++++++++++++++++++++++++++++ opdb/__init__.py | 0 pyproject.toml | 11 +++++++++++ 3 files changed, 44 insertions(+) create mode 100644 .woodpecker.yml create mode 100644 opdb/__init__.py create mode 100644 pyproject.toml diff --git a/.woodpecker.yml b/.woodpecker.yml new file mode 100644 index 0000000..28a337f --- /dev/null +++ b/.woodpecker.yml @@ -0,0 +1,33 @@ +pipeline: + install-linters: + image: python:${PYTHON_VERSION} + commands: + - pip3 install flake8 mypy black + flake8: + group: lint + image: python:${PYTHON_VERSION} + commands: + - flake8 opdb/ + mypy: + group: lint + image: python:${PYTHON_VERSION} + commands: + - mypy opdb + black: + group: lint + image: python:${PYTHON_VERSION} + commands: + - black --check opdb/ + install: + image: python:${PYTHON_VERSION} + commands: + - pip3 install . + test: + image: python:${PYTHON_VERSION} + commands: + - pytest + +matrix: + PYTHON_VERSION: + - 3.7 + - 3.10 diff --git a/opdb/__init__.py b/opdb/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..dcb66ab --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,11 @@ +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + +[project] +name = "opdb" +version = "0.0.1" +dependencies = [ + "requests", + "luigi", +] -- 2.40.1 From 9cd549d30c7419c5d550ccb2ae6625a2e9afa967 Mon Sep 17 00:00:00 2001 From: Val Lorentz Date: Wed, 14 Sep 2022 18:15:49 +0200 Subject: [PATCH 2/5] /usr is not persisted across steps --- .woodpecker.yml | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index 28a337f..b04e6cc 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -1,30 +1,25 @@ pipeline: - install-linters: - image: python:${PYTHON_VERSION} - commands: - - pip3 install flake8 mypy black flake8: group: lint image: python:${PYTHON_VERSION} commands: + - pip3 install flake8 - flake8 opdb/ mypy: group: lint image: python:${PYTHON_VERSION} commands: + - pip3 install mypy - mypy opdb black: group: lint - image: python:${PYTHON_VERSION} + image: pyfound/black:22.8.0 commands: - black --check opdb/ - install: - image: python:${PYTHON_VERSION} - commands: - - pip3 install . test: image: python:${PYTHON_VERSION} commands: + - pip3 install . - pytest matrix: -- 2.40.1 From 7c9a3b5b509ba3f266eb4da6b5afc5d8aee77689 Mon Sep 17 00:00:00 2001 From: Val Lorentz Date: Wed, 14 Sep 2022 18:19:54 +0200 Subject: [PATCH 3/5] Properly initialize pytest --- .woodpecker.yml | 2 +- opdb/foo_test.py | 2 ++ pyproject.toml | 3 +++ 3 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 opdb/foo_test.py diff --git a/.woodpecker.yml b/.woodpecker.yml index b04e6cc..31b18f2 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -19,7 +19,7 @@ pipeline: test: image: python:${PYTHON_VERSION} commands: - - pip3 install . + - pip3 install . pytest - pytest matrix: diff --git a/opdb/foo_test.py b/opdb/foo_test.py new file mode 100644 index 0000000..8f2d73c --- /dev/null +++ b/opdb/foo_test.py @@ -0,0 +1,2 @@ +def test_foo(): + pass diff --git a/pyproject.toml b/pyproject.toml index dcb66ab..169f4dc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,3 +9,6 @@ dependencies = [ "requests", "luigi", ] + +[tool.pytest.ini_options] +python_files = "*_test.py" -- 2.40.1 From d576b125866fe92bf356899d9370871569990493 Mon Sep 17 00:00:00 2001 From: Val Lorentz Date: Wed, 14 Sep 2022 18:25:50 +0200 Subject: [PATCH 4/5] Add Makefile --- .woodpecker.yml | 8 ++++---- Makefile | 18 ++++++++++++++++++ 2 files changed, 22 insertions(+), 4 deletions(-) create mode 100644 Makefile diff --git a/.woodpecker.yml b/.woodpecker.yml index 31b18f2..7889801 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -4,23 +4,23 @@ pipeline: image: python:${PYTHON_VERSION} commands: - pip3 install flake8 - - flake8 opdb/ + - make flake8 mypy: group: lint image: python:${PYTHON_VERSION} commands: - pip3 install mypy - - mypy opdb + - make mypy black: group: lint image: pyfound/black:22.8.0 commands: - - black --check opdb/ + - make black-check test: image: python:${PYTHON_VERSION} commands: - pip3 install . pytest - - pytest + - make pytest matrix: PYTHON_VERSION: diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..abaaf8c --- /dev/null +++ b/Makefile @@ -0,0 +1,18 @@ +black-check: + black --check opdb/ + +black: + black opdb/ + +flake8: + flake8 opdb/ + +mypy: + mypy opdb + +pytest: + pytest + +test: black flake8 mypy pytest + +.PHONY: black black-check flake8 mypy pytest test -- 2.40.1 From 511d54473d6e591586225e87b3e04ab75ad107ad Mon Sep 17 00:00:00 2001 From: Val Lorentz Date: Wed, 14 Sep 2022 18:26:53 +0200 Subject: [PATCH 5/5] No Make in the Black container --- .woodpecker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index 7889801..6c3c2f0 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -15,7 +15,7 @@ pipeline: group: lint image: pyfound/black:22.8.0 commands: - - make black-check + - black --check opdb/ test: image: python:${PYTHON_VERSION} commands: -- 2.40.1