diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 76aa3cba344e0b953225206576d7da92a407d334..cff5349f38eb02327cbd3352e9d8cf2c92c2d714 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,11 +1,18 @@ stages: - - test + - code_quality + - test include: - local: 'templates/python/testing/pytest/pytest.yml' + - local: 'templates/python/code_quality/flake8/flake8.yml' pytest: variables: - IMAGE_TAG: "latest" PROJECT_PATH: "tests/pytest_project" PYTHON_SETUP: "pip install ${PROJECT_PATH} pytest" + +flake8: + variables: + IMAGE_TAG: "latest" + PROJECT_PATH: "tests/flake8_project" + PYTHON_SETUP: "pip install ${PROJECT_PATH} flake8" diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000000000000000000000000000000000000..6f9451fb1b905ce4605b77b6e7d9e10493629650 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,14 @@ +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[tool.hatch.metadata] +allow-direct-references = true + +[project] +name = "r2devops_catalog" +version = "0.1.0" +authors = [ + { name = "Dorian Turba", email = "author.name@example.com" }, +] +description = "A description of what the package is for." diff --git a/tests/flake8_project/pyproject.toml b/tests/flake8_project/pyproject.toml new file mode 100644 index 0000000000000000000000000000000000000000..eb3a8418db02a20c20f9be1933c768c7576c65b0 --- /dev/null +++ b/tests/flake8_project/pyproject.toml @@ -0,0 +1,11 @@ +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[project] +name = "flake8_project" +version = "0.1.0" +authors = [ + { name = "Author Name", email = "author.name@example.com" }, +] +description = "A description of what the package is for." diff --git a/tests/pytest_project/src/test_project/__init__.py b/tests/flake8_project/src/flake8_project/__init__.py similarity index 100% rename from tests/pytest_project/src/test_project/__init__.py rename to tests/flake8_project/src/flake8_project/__init__.py diff --git a/tests/pytest_project/src/test_project/main.py b/tests/flake8_project/src/flake8_project/main.py similarity index 100% rename from tests/pytest_project/src/test_project/main.py rename to tests/flake8_project/src/flake8_project/main.py diff --git a/tests/pytest_project/pyproject.toml b/tests/pytest_project/pyproject.toml index 69a33200081eacfb75d3a7d51966ba4c046e60b5..b72bdace191a06760e4d8606b685f7204c7c515f 100644 --- a/tests/pytest_project/pyproject.toml +++ b/tests/pytest_project/pyproject.toml @@ -3,7 +3,7 @@ requires = ["hatchling"] build-backend = "hatchling.build" [project] -name = "test_project" +name = "pytest_project" version = "0.1.0" authors = [ { name = "Author Name", email = "author.name@example.com" }, diff --git a/tests/pytest_project/src/pytest_project/__init__.py b/tests/pytest_project/src/pytest_project/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..d4cc63e287d1f9b8e3f12a55c9a24e34eb3241c3 --- /dev/null +++ b/tests/pytest_project/src/pytest_project/__init__.py @@ -0,0 +1,3 @@ +from pytest_project.main import main + +__all__ = ['main'] diff --git a/tests/pytest_project/src/pytest_project/main.py b/tests/pytest_project/src/pytest_project/main.py new file mode 100644 index 0000000000000000000000000000000000000000..28caf00b6f3b52955a2bc069b315fe44940eabb8 --- /dev/null +++ b/tests/pytest_project/src/pytest_project/main.py @@ -0,0 +1,11 @@ +"""Sample main module.""" + + +def main() -> bool: + """Sample main function.""" + print("Hello, world!") + return True + + +if __name__ == '__main__': + main() diff --git a/tests/pytest_project/src/test_project/py.typed b/tests/pytest_project/src/test_project/py.typed deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/tests/pytest_project/tests/test_main.py b/tests/pytest_project/tests/test_main.py index 0c0a1de27ba48328e022ec7c0e0387e39aa75c74..9206179448d10b6c5484e907ae0786cf7b0d8ed2 100644 --- a/tests/pytest_project/tests/test_main.py +++ b/tests/pytest_project/tests/test_main.py @@ -1,6 +1,6 @@ """Sample test module.""" -from test_project import main +from pytest_project import main def test_main():