From e803a2daac01462daa87447addc576e84c52ddef Mon Sep 17 00:00:00 2001 From: Gleb Levitski <36483986+glevv@users.noreply.github.com> Date: Sun, 26 Nov 2023 09:40:22 +0200 Subject: [PATCH] added support for older python, added matrix, added publish action --- .github/workflows/package.yml | 10 +++++-- .github/workflows/publish.yml | 51 +++++++++++++++++++++++++++++++++++ pyproject.toml | 8 +++--- 3 files changed, 63 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml index 60fdc7b..bdb4e00 100644 --- a/.github/workflows/package.yml +++ b/.github/workflows/package.yml @@ -17,6 +17,8 @@ jobs: runs-on: ubuntu-latest strategy: fail-fast: True + matrix: + python-version: [3.9, 3.10, 3.11, 3.12] defaults: run: shell: bash @@ -24,11 +26,12 @@ jobs: steps: - name: Check out repository uses: actions/checkout@v3 - - name: Set up python + + - name: Set up Python ${{ matrix.python-version }} id: setup-python uses: actions/setup-python@v4 with: - python-version: '3.11' + python-version: ${{ matrix.python-version }} - name: Install Poetry uses: snok/install-poetry@v1 @@ -67,8 +70,11 @@ jobs: - name: Upload coverage to Codecov uses: codecov/codecov-action@v3 + if: matrix.python-version == '3.11' with: flags: smart-tests verbose: true + file: ./coverage.xml + fail_ci_if_error: true env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..bca5615 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,51 @@ +name: Release + +on: + release: + types: + - created + +jobs: + publish: + strategy: + fail-fast: false + runs-on: ubuntu-latest + steps: + - name: Check-out repository + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.11" + + - name: Load cached Poetry installation + id: cached-poetry + uses: actions/cache@v3 + with: + path: ~/.local # the path depends on the OS + key: poetry # increment to reset cache + + - name: Install poetry + if: steps.cached-poetry.outputs.cache-hit != 'true' + uses: snok/install-poetry@v1 + + - name: Restore cached dependencies + uses: actions/cache@v3 + with: + path: ~/.cache/pypoetry + key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }} + restore-keys: | + ${{ runner.os }}-poetry- + + - name: Install package + run: poetry install + + - name: Publish + env: + PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} + run: | + poetry config pypi-token.pypi $PYPI_TOKEN + poetry publish --build \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 225a4c8..3083f1f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,14 +1,14 @@ [tool.poetry] name = "obscure_stats" -version = "0.1.1" +version = "0.1.2" description = "Collection of less known statistical functions" authors = ["Gleb Levitski"] readme = "README.md" [tool.poetry.dependencies] -python = ">=3.10,<3.13" -numpy = "^1.26.1" -scipy = "^1.11.3" +python = ">=3.9,<3.13" +numpy = "^1.23.5" +scipy = "^1.9.1" [tool.poetry.group.dev.dependencies]