diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..4d1ff5d --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,25 @@ +name: Lint + +on: + push: + paths-ignore: + - 'docs/**' + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + cache: 'pip' + python-version: 3.12 + + - name: Lint with ruff + run: | + python -m pip install ruff + ruff check src/ + ruff format --check src/ diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 41a5679..40896ab 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,23 +10,19 @@ jobs: name: Build macOS wheels runs-on: macos-latest - strategy: - matrix: - python-version: ['3.10'] - steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Create release - uses: softprops/action-gh-release@v1 + uses: softprops/action-gh-release@v2 with: name: evora_wheel ${{ github.ref_name }} - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: - python-version: ${{ matrix.python-version }} + cache: 'pip' - name: Install dependencies run: | diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index 5f59924..0000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,60 +0,0 @@ -name: Test - -on: - push: - paths-ignore: - - 'docs/**' - -jobs: - build: - runs-on: ubuntu-latest - - strategy: - fail-fast: false - matrix: - python-version: ['3.10', '3.11'] - - steps: - - uses: actions/checkout@v3 - - - name: Cache Setup - uses: actions/cache@v3 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} - - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - - name: Install dependencies - run: | - python -m pip install --upgrade pip wheel setuptools - python -m pip install --use-pep517 . - - - name: Lint with flake8 - run: | - # stop the build if there are Python syntax errors or undefined names - python -m pip install flake8 - flake8 . --count --show-source --statistics - - - name: Lint with isort - run: | - python -m pip install isort - isort -c src/ - - - name: Lint with black - run: | - python -m pip install black - black --check src/ - - # - name: Test with pytest - # run: | - # python -m pip install pytest pytest-mock pytest-asyncio pytest-cov pyserial-asyncio - # pytest - - # - name: Upload coverage to Codecov - # uses: codecov/codecov-action@v3 - # with: - # file: ./coverage.xml diff --git a/pyproject.toml b/pyproject.toml index 388618c..6f20803 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,7 +8,7 @@ readme = "README.md" packages = [{include = "evora_wheel", from = "src"}] [tool.poetry.dependencies] -python = "^3.9,<3.12" +python = "^3.9,<4" daemonocle = "^1.0.2" click = "^8.1.3" sdsstools = "^1.0.2" @@ -18,26 +18,32 @@ pyserial = "^3.5" [tool.poetry.dev-dependencies] ipython = ">=8.0.0" -flake8 = ">=3.7.9" -isort = ">=5.0.0" ipdb = ">=0.13.3" -black = {version = ">=21.10b0", allow-prereleases = true} +ruff = ">=0.4.0" [tool.poetry.scripts] evora-wheel = "evora_wheel.__main__:evora_wheel" -[tool.black] +[tool.ruff] line-length = 88 -target-version = ['py311'] -fast = true - -[tool.isort] -profile = "black" -sections = ["FUTURE", "STDLIB", "TYPING", "THIRDPARTY", "FIRSTPARTY", "LOCALFOLDER"] -default_section = "THIRDPARTY" -known_first_party = "evora_wheel" -known_typing = ["typing"] -lines_after_imports = 2 +target-version = 'py312' +exclude = ["typings/"] + +[ruff.lint] +select = ["E", "F", "I"] +unfixable = ["F841"] + +[tool.ruff.lint.per-file-ignores] +"__init__.py" = ["F401", "F403", "E402"] + +[tool.ruff.lint.isort] +known-first-party = ["evora_wheel"] +lines-after-imports = 2 +section-order = ["future", "standard-library", "typing", "third-party", "sdss", "first-party", "local-folder"] + +[tool.ruff.lint.isort.sections] +typing = ["typing"] +sdss = ["sdsstools"] [build-system] requires = ["poetry-core>=1.1.0"]