From c74677e953e926e589e1b2af480d8ea8d9bbea1d Mon Sep 17 00:00:00 2001 From: Martin Kysel Date: Sun, 13 Nov 2022 14:03:31 -0300 Subject: [PATCH 1/6] add CI steps for python --- .github/workflows/python.yml | 33 +++++++++++++++++++++++++++++++++ .gitignore | 2 ++ justfile | 5 ++++- 3 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/python.yml diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml new file mode 100644 index 0000000..6cc2963 --- /dev/null +++ b/.github/workflows/python.yml @@ -0,0 +1,33 @@ +name: Python +on: + push: + branches: [ main ] + pull_request: + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: extractions/setup-just@v1 + with: + just-version: '1.4.0' + - uses: actions/setup-python@v3 + with: + python-version: '3.10' + cache: 'pip' + - run: just black + PyTest: + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - name: Check out repository code + uses: actions/checkout@v3 + - uses: extractions/setup-just@v1 + with: + just-version: '1.4.0' + - uses: actions/setup-python@v3 + with: + python-version: '3.10' + cache: 'pip' + - run: just pytest \ No newline at end of file diff --git a/.gitignore b/.gitignore index 920a4a7..e667a14 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,5 @@ perf.data.old flamegraph.svg Cargo.lock poetry.lock + +/venv/ diff --git a/justfile b/justfile index bda1e4a..8df51f6 100644 --- a/justfile +++ b/justfile @@ -40,4 +40,7 @@ clippy: # Runs black to format Python code black: - poetry run black . + poetry run black --check . + +pytest: + poetry run pytest . --junitxml=test-results.xml -v \ No newline at end of file From 6cf6293c5b65a4bd336be3015bb5962262fe81cc Mon Sep 17 00:00:00 2001 From: Martin Kysel Date: Sun, 13 Nov 2022 14:04:29 -0300 Subject: [PATCH 2/6] remove pip --- .github/workflows/python.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index 6cc2963..828a610 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -15,7 +15,6 @@ jobs: - uses: actions/setup-python@v3 with: python-version: '3.10' - cache: 'pip' - run: just black PyTest: runs-on: ubuntu-latest @@ -29,5 +28,4 @@ jobs: - uses: actions/setup-python@v3 with: python-version: '3.10' - cache: 'pip' - run: just pytest \ No newline at end of file From f8554eb94e1d90f2bed23e8cdbd0c01ab48dee92 Mon Sep 17 00:00:00 2001 From: Martin Kysel Date: Sun, 13 Nov 2022 14:06:20 -0300 Subject: [PATCH 3/6] install poetry --- .github/workflows/python.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index 828a610..fab9ef7 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -12,6 +12,9 @@ jobs: - uses: extractions/setup-just@v1 with: just-version: '1.4.0' + - uses: snok/install-poetry@v1 + with: + version: 1.2.2 - uses: actions/setup-python@v3 with: python-version: '3.10' @@ -25,6 +28,9 @@ jobs: - uses: extractions/setup-just@v1 with: just-version: '1.4.0' + - uses: snok/install-poetry@v1 + with: + version: 1.2.2 - uses: actions/setup-python@v3 with: python-version: '3.10' From 6047da8c6f239109b18b8008f25aca62d918009e Mon Sep 17 00:00:00 2001 From: Martin Kysel Date: Sun, 13 Nov 2022 14:09:36 -0300 Subject: [PATCH 4/6] install --- .github/workflows/python.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index fab9ef7..8316d0f 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -18,6 +18,7 @@ jobs: - uses: actions/setup-python@v3 with: python-version: '3.10' + - run: poetry install - run: just black PyTest: runs-on: ubuntu-latest @@ -34,4 +35,5 @@ jobs: - uses: actions/setup-python@v3 with: python-version: '3.10' + - run: poetry install - run: just pytest \ No newline at end of file From 27ae5ce0173e1ba50d6ed0590c899ca93ab67648 Mon Sep 17 00:00:00 2001 From: Martin Kysel Date: Sun, 13 Nov 2022 14:13:45 -0300 Subject: [PATCH 5/6] pytests are already being run in the rust suite --- .github/workflows/python.yml | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index 8316d0f..984c2d2 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -19,21 +19,4 @@ jobs: with: python-version: '3.10' - run: poetry install - - run: just black - PyTest: - runs-on: ubuntu-latest - timeout-minutes: 10 - steps: - - name: Check out repository code - uses: actions/checkout@v3 - - uses: extractions/setup-just@v1 - with: - just-version: '1.4.0' - - uses: snok/install-poetry@v1 - with: - version: 1.2.2 - - uses: actions/setup-python@v3 - with: - python-version: '3.10' - - run: poetry install - - run: just pytest \ No newline at end of file + - run: just black \ No newline at end of file From 88a97b6447a1788750b0a4a81759c7fbb19a770e Mon Sep 17 00:00:00 2001 From: Martin Kysel Date: Sun, 13 Nov 2022 14:32:35 -0300 Subject: [PATCH 6/6] cleanup --- .github/workflows/python.yml | 13 ++++--------- .gitignore | 2 -- justfile | 4 ++-- 3 files changed, 6 insertions(+), 13 deletions(-) diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index 984c2d2..f06385c 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -8,15 +8,10 @@ jobs: lint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: extractions/setup-just@v1 - with: - just-version: '1.4.0' - - uses: snok/install-poetry@v1 - with: - version: 1.2.2 - - uses: actions/setup-python@v3 + - uses: actions/checkout@v3 + - uses: actions/setup-python@v2 with: python-version: '3.10' + - uses: abatilo/actions-poetry@v2.1.4 - run: poetry install - - run: just black \ No newline at end of file + - run: poetry run black --check --verbose . \ No newline at end of file diff --git a/.gitignore b/.gitignore index e667a14..920a4a7 100644 --- a/.gitignore +++ b/.gitignore @@ -9,5 +9,3 @@ perf.data.old flamegraph.svg Cargo.lock poetry.lock - -/venv/ diff --git a/justfile b/justfile index 8df51f6..9189728 100644 --- a/justfile +++ b/justfile @@ -42,5 +42,5 @@ clippy: black: poetry run black --check . -pytest: - poetry run pytest . --junitxml=test-results.xml -v \ No newline at end of file +pytest: develop + poetry run pytest \ No newline at end of file