From 1b138c559e66e4edf8f23d03e4703a163cd00e46 Mon Sep 17 00:00:00 2001 From: Tim Paine <3105306+timkpaine@users.noreply.github.com> Date: Sun, 23 Jun 2024 22:39:40 -0400 Subject: [PATCH] Update ruff usage, enforce format, update workflows --- .github/dependabot.yml | 6 ++++++ .github/workflows/build.yml | 8 ++++---- .github/workflows/deploy.yml | 4 +--- .github/workflows/regression.yml | 8 ++++---- Makefile | 3 ++- pyproject.toml | 2 +- setup.py | 5 ++++- 7 files changed, 22 insertions(+), 14 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 5ace4600..9d2674e5 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -4,3 +4,9 @@ updates: directory: "/" schedule: interval: "weekly" + + - package-ecosystem: "pip" + directory: "/" + schedule: + interval: "monthly" + diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ce1b10c6..576ce97f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,7 +22,9 @@ jobs: python-version: [3.11] steps: - - uses: actions/checkout@v4 + - name: Checkout + uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v5 with: @@ -31,9 +33,7 @@ jobs: cache-dependency-path: 'setup.py' - name: Install dependencies - run: | - make develop - python -m pip install -U wheel twine setuptools + run: make develop - name: Lint run: make lint diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 941d7989..c93f1861 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -146,9 +146,7 @@ jobs: python-version: ${{ matrix.python-version }} - name: Install dependencies - run: | - make develop - python -m pip install -U wheel twine setuptools + run: make develop - name: Python SDist Steps run: python setup.py sdist diff --git a/.github/workflows/regression.yml b/.github/workflows/regression.yml index 3da47f8d..1c4303ab 100644 --- a/.github/workflows/regression.yml +++ b/.github/workflows/regression.yml @@ -31,7 +31,9 @@ jobs: pandas_version: '<2' steps: - - uses: actions/checkout@v4 + - name: Checkout + uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v5 with: @@ -40,9 +42,7 @@ jobs: cache-dependency-path: 'setup.py' - name: Install dependencies - run: | - make develop - python -m pip install -U wheel twine setuptools "numpy${{ matrix.numpy_version }}" "pandas${{ matrix.pandas_version}}" + run: make develop - name: Test run: make test diff --git a/Makefile b/Makefile index 25f507c8..9cd9a738 100644 --- a/Makefile +++ b/Makefile @@ -11,7 +11,8 @@ test: python -m pytest -vvv tests --cov=bt --junitxml=python_junit.xml --cov-report=xml --cov-branch --cov-report term lint: - python -m ruff bt setup.py docs/source/conf.py + python -m ruff check bt setup.py docs/source/conf.py + python -m ruff format --check bt setup.py docs/source/conf.py fix: python -m ruff format bt setup.py docs/source/conf.py diff --git a/pyproject.toml b/pyproject.toml index fa5ab7b6..df906df7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,5 +4,5 @@ requires = ["setuptools", "wheel", "cython>=0.29.25"] [tool.ruff] line-length = 180 -[tool.ruff.per-file-ignores] +[tool.ruff.lint.per-file-ignores] "__init__.py" = ["F401", "F403"] diff --git a/setup.py b/setup.py index acb8813c..e7b48d6f 100644 --- a/setup.py +++ b/setup.py @@ -47,7 +47,10 @@ def local_file(filename): "pyprind>=2.11", "pytest", "pytest-cov", - "ruff", + "ruff>=0.3,<0.5", + "setuptools", + "twine", + "wheel", ], }, packages=["bt"],