From 165dbc4efec0c8ff7a754269c4690d6d59446cf1 Mon Sep 17 00:00:00 2001 From: joncrall Date: Fri, 13 Sep 2024 10:52:04 -0400 Subject: [PATCH] Update xcookie --- .github/workflows/tests.yml | 52 +++++++++++++++++++++++++------------ docs/source/conf.py | 2 +- pyproject.toml | 2 +- 3 files changed, 38 insertions(+), 18 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 1b186a7..47118a3 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -23,7 +23,7 @@ jobs: - name: Checkout source uses: actions/checkout@v4.1.1 - name: Set up Python 3.12 for linting - uses: actions/setup-python@v5.0.0 + uses: actions/setup-python@v5.1.1 with: python-version: '3.12' - name: Install dependencies @@ -51,7 +51,7 @@ jobs: - name: Checkout source uses: actions/checkout@v4.1.1 - name: Set up Python 3.12 - uses: actions/setup-python@v5.0.0 + uses: actions/setup-python@v5.1.1 with: python-version: '3.12' - name: Upgrade pip @@ -62,9 +62,9 @@ jobs: - name: Build sdist shell: bash run: |- - python -m pip install pip -U - python -m pip install setuptools>=0.8 wheel build + python -m pip install setuptools>=0.8 wheel build twine python -m build --sdist --outdir wheelhouse + python -m twine check ./wheelhouse/line_profiler*.tar.gz - name: Install sdist run: |- ls -al wheelhouse @@ -102,7 +102,7 @@ jobs: name: Upload sdist artifact with: name: sdist_wheels - path: wheelhouse/*.tar.gz + path: ./wheelhouse/line_profiler*.tar.gz build_binpy_wheels: ## # Build the binary wheels. Note: even though cibuildwheel will test @@ -135,7 +135,7 @@ jobs: uses: ilammy/msvc-dev-cmd@v1 if: matrix.os == 'windows-latest' && ${{ contains(matrix.cibw_skip, '*-win32') }} - name: Set up QEMU - uses: docker/setup-qemu-action@v3 + uses: docker/setup-qemu-action@v3.0.0 if: runner.os == 'Linux' && matrix.arch != 'auto' with: platforms: all @@ -151,7 +151,7 @@ jobs: shell: bash run: ls -la wheelhouse - name: Set up Python 3.12 to combine coverage - uses: actions/setup-python@v5.0.0 + uses: actions/setup-python@v5.1.1 if: runner.os == 'Linux' with: python-version: '3.12' @@ -170,6 +170,14 @@ jobs: echo '### The cwd should now have a coverage.xml' ls -altr pwd + - uses: codecov/codecov-action@v4.0.1 + name: Codecov Upload + env: + HAVE_CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN != '' }} + if: ${{ env.HAVE_PERSONAL_TOKEN == 'true' }} + with: + file: ./coverage.xml + token: ${{ secrets.CODECOV_TOKEN }} - uses: codecov/codecov-action@v4.0.1 name: Codecov Upload with: @@ -320,12 +328,12 @@ jobs: uses: ilammy/msvc-dev-cmd@v1 if: matrix.os == 'windows-latest' - name: Set up QEMU - uses: docker/setup-qemu-action@v3 + uses: docker/setup-qemu-action@v3.0.0 if: runner.os == 'Linux' && matrix.arch != 'auto' with: platforms: all - name: Setup Python - uses: actions/setup-python@v5.0.0 + uses: actions/setup-python@v5.1.1 with: python-version: ${{ matrix.python-version }} - uses: actions/download-artifact@v2.1.1 @@ -343,11 +351,23 @@ jobs: echo "Installing helpers" pip install setuptools>=0.8 setuptools_scm wheel build -U pip install tomli pkginfo - export WHEEL_FPATH=$(python -c "import pathlib; print(str(sorted(pathlib.Path('wheelhouse').glob('line_profiler*.whl'))[-1]).replace(chr(92), chr(47)))") - export MOD_VERSION=$(python -c "from pkginfo import Wheel; print(Wheel('$WHEEL_FPATH').version)") - echo "$WHEEL_FPATH=WHEEL_FPATH" - echo "$INSTALL_EXTRAS=INSTALL_EXTRAS" - echo "$MOD_VERSION=MOD_VERSION" + export WHEEL_FPATH=$(python -c "if 1: + import pathlib + dist_dpath = pathlib.Path('wheelhouse') + candidates = list(dist_dpath.glob('line_profiler*.whl')) + candidates += list(dist_dpath.glob('line_profiler*.tar.gz')) + fpath = sorted(candidates)[-1] + print(str(fpath).replace(chr(92), chr(47))) + ") + export MOD_VERSION=$(python -c "if 1: + from pkginfo import Wheel, SDist + fpath = '$WHEEL_FPATH' + cls = Wheel if fpath.endswith('.whl') else SDist + print(cls(fpath).version) + ") + echo "WHEEL_FPATH=$WHEEL_FPATH" + echo "INSTALL_EXTRAS=$INSTALL_EXTRAS" + echo "MOD_VERSION=$MOD_VERSION" pip install --prefer-binary "line_profiler[$INSTALL_EXTRAS]==$MOD_VERSION" -f wheelhouse echo "Install finished." - name: Test wheel ${{ matrix.install-extras }} @@ -402,7 +422,7 @@ jobs: file: ./coverage.xml token: ${{ secrets.CODECOV_TOKEN }} test_deploy: - name: Uploading Test to PyPi + name: Deploy Test runs-on: ubuntu-latest if: github.event_name == 'push' && ! startsWith(github.event.ref, 'refs/tags') && ! startsWith(github.event.ref, 'refs/heads/release') needs: @@ -476,7 +496,7 @@ jobs: wheelhouse/*.asc wheelhouse/*.ots live_deploy: - name: Uploading Live to PyPi + name: Deploy Live runs-on: ubuntu-latest if: github.event_name == 'push' && (startsWith(github.event.ref, 'refs/tags') || startsWith(github.event.ref, 'refs/heads/release')) needs: diff --git a/docs/source/conf.py b/docs/source/conf.py index 596d0eb..049f62d 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -17,7 +17,7 @@ # need to edit the conf.py cd ~/code/line_profiler/docs - sphinx-apidoc --private --separate -f -o ~/code/line_profiler/docs/source/auto ~/code/line_profiler/line_profiler + sphinx-apidoc --private --separate --force --output-dir ~/code/line_profiler/docs/source/auto ~/code/line_profiler/line_profiler # Note: the module should importable before running this # (e.g. install it in developer mode or munge the PYTHONPATH) diff --git a/pyproject.toml b/pyproject.toml index f504262..d0ab368 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -56,7 +56,7 @@ mod_name = "line_profiler" repo_name = "line_profiler" rel_mod_parent_dpath = "." os = [ "all", "linux", "osx", "win",] -min_python = 3.6 +min_python = '3.6' author = "Robert Kern" author_email = "robert.kern@enthought.com" description = "Line-by-line profiler"