Skip to content

Commit

Permalink
Format code with ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
albireox committed Jul 18, 2024
1 parent 263f441 commit 20ac5c9
Show file tree
Hide file tree
Showing 10 changed files with 636 additions and 732 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@ name: Docker

on:
push:
branches:
- main
tags:
- '*'
paths-ignore:
- 'docs/**'
pull_request:
paths-ignore:
- 'docs/**'

Expand Down
6 changes: 1 addition & 5 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,4 @@ jobs:
run: |
pip install ruff
ruff src/too tests/
- name: Lint with black
run: |
pip install black
black --check src/too tests/
ruff format --check src/too tests/
11 changes: 4 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ jobs:
name: Build wheels
runs-on: ubuntu-latest

strategy:
matrix:
python-version: ['3.12']

permissions:
contents: write
id-token: write
Expand All @@ -23,14 +19,15 @@ jobs:
uses: actions/checkout@v4

- name: Create release
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
with:
name: ToO ${{ github.ref_name }}

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
python-version: 3.12
cache: 'pip'

- name: Install dependencies
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
key: ${{ runner.os }}-config-sdss

- name: Install Postgresql
uses: ikalnytskyi/action-setup-postgres@v5
uses: ikalnytskyi/action-setup-postgres@v6
with:
username: sdss
id: postgres
Expand Down
1,330 changes: 627 additions & 703 deletions poetry.lock

Large diffs are not rendered by default.

6 changes: 0 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ sdss-coordio = "^1.10.0"
[tool.poetry.group.dev.dependencies]
ipython = ">=8.21.0"
ipdb = ">=0.12.3"
black = ">=24.1.1"
ruff = ">=0.1.0"
pandas-stubs = "^2.1.4.231227"
pytest = "^8.0.0"
Expand All @@ -42,11 +41,6 @@ pytest-cov = "^4.1.0"
coverage = "^7.4.1"
pytest-mock = "^3.14.0"

[tool.black]
line-length = 88
target-version = ['py312']
fast = true

[tool.ruff]
line-length = 88
target-version = 'py312'
Expand Down
1 change: 0 additions & 1 deletion src/too/validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,6 @@ class DesignMode:
"""

def __init__(self, database: PeeweeDatabaseConnection, label: str | None = None):

from sdssdb.peewee.sdss5db.targetdb import DesignMode as DesignModeDB

DesignModeDB._meta.database(database) # type:ignore
Expand Down
1 change: 0 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ def truncate_too_target():

@pytest.fixture(scope="session")
def too_mock():

random.seed(SEED)
numpy.random.seed(SEED)
polars.set_random_seed(SEED)
Expand Down
1 change: 0 additions & 1 deletion tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

@pytest.fixture(scope="module")
def files_path(tmp_path_factory: pytest.TempPathFactory):

yield tmp_path_factory.mktemp("too_files")


Expand Down
3 changes: 0 additions & 3 deletions tests/test_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@


if TYPE_CHECKING:

pass


Expand Down Expand Up @@ -88,7 +87,6 @@ def test_get_database_uri(
port: int | None,
expected: str,
):

uri = get_database_uri(
dbname,
user=user,
Expand Down Expand Up @@ -126,7 +124,6 @@ def test_load_too_targets_from_file(
tmp_path,
extension: str,
):

too_mock_sample = too_mock[0:1000]

if extension == "parquet":
Expand Down

0 comments on commit 20ac5c9

Please sign in to comment.