Skip to content

Commit

Permalink
Update ruff usage, enforce format, update workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
timkpaine committed Jun 24, 2024
1 parent 43983f6 commit 1b138c5
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 14 deletions.
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,9 @@ updates:
directory: "/"
schedule:
interval: "weekly"

- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "monthly"

8 changes: 4 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/regression.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
5 changes: 4 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand Down

0 comments on commit 1b138c5

Please sign in to comment.