Skip to content

Commit

Permalink
Merge pull request #60 from flatironinstitute/fix/ci
Browse files Browse the repository at this point in the history
Clean up Github Actions
  • Loading branch information
WardBrian authored Oct 4, 2023
2 parents 99f511a + 658da5d commit d8a8e4b
Show file tree
Hide file tree
Showing 17 changed files with 160 additions and 331 deletions.
10 changes: 0 additions & 10 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,3 @@ updates:
commit-message:
prefix: ":arrow_up:"
open-pull-requests-limit: 50

- package-ecosystem: "docker"
directory: "/docker"
schedule:
interval: "weekly"
allow:
- dependency-type: "all"
commit-message:
prefix: ":arrow_up:"
open-pull-requests-limit: 50
28 changes: 0 additions & 28 deletions .github/release-drafter.yml

This file was deleted.

41 changes: 0 additions & 41 deletions .github/workflows/build_windows.yml

This file was deleted.

33 changes: 16 additions & 17 deletions .github/workflows/build_ubuntu.yml → .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: build_ubuntu
name: lint

on:
push:
Expand All @@ -7,40 +7,39 @@ on:
branches: [ main ]

jobs:
build:
mypy_ruff:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11"]

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
- name: Set up Python
uses: actions/[email protected]
with:
python-version: ${{ matrix.python-version }}
python-version: "3.11"

- name: Set up cache
uses: actions/[email protected]
with:
path: .venv
key: venv-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml') }}
key: venv-${{ hashFiles('pyproject.toml', 'requirements.txt') }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install ruff pytest mypy
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
pip install -e .
pip install -e .[dev]
- name: Check formatting
run: |
isort --check .
black --check .
- name: Lint with ruff
run: |
# stop the build if there are Python syntax errors or undefined names
ruff --format=github --select=E9,F63,F7,F82 --target-version=py39 pytorch_finufft
ruff --output-format=github --select=E9,F63,F7,F82 --target-version=py37 pytorch_finufft
# default set of ruff rules with GitHub Annotations
ruff --format=github --target-version=py37 pytorch_finufft
ruff --output-format=github --target-version=py37 pytorch_finufft
- name: Lint with mypy
run: |
mypy pytorch_finufft/
16 changes: 0 additions & 16 deletions .github/workflows/release-drafter.yml

This file was deleted.

10 changes: 5 additions & 5 deletions .github/workflows/test_ubuntu.yml → .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: test_ubuntu
name: test

on:
push:
Expand All @@ -7,11 +7,12 @@ on:
branches: [ main ]

jobs:
build:
pytest:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11"]
fail-fast: false

steps:
- uses: actions/checkout@v3
Expand All @@ -29,9 +30,8 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install ruff pytest mypy
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
pip install .[dev]
- name: Pytest
run: |
pytest tests/
pytest tests/ --cov
112 changes: 34 additions & 78 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,22 +1,18 @@
# Poetry pyproject.toml: https://python-poetry.org/docs/pyproject/
[build-system]
requires = ["poetry_core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
requires = ["setuptools"]
build-backend = "setuptools.build_meta"

[tool.poetry]
[project]
name = "pytorch_finufft"
version = "0.0.0"
description = "Pytorch bindings for the FINUFFT Library"
readme = "README.md"
authors = ["Matthew Meeker <[email protected]>", "Michael Eickenberg <[email protected]>", "Brian Ward <[email protected]>"]
license = "MIT"
repository = "https://github.com/flatironinstitute/pytorch-finufft"
homepage = "https://github.com/flatironinstitute/pytorch-finufft"

# Keywords description https://python-poetry.org/docs/pyproject/#keywords
keywords = [] #! Update me

# Pypi classifiers: https://pypi.org/classifiers/
authors = [
{name = "Matthew Meeker", email="[email protected]"},
{name = "Michael Eickenberg", email="[email protected]"},
{name = "Brian Ward", email="[email protected]"},
]
license = { text = "MIT" }
dependencies = ["finufft", "torch >= 2", "numpy", "scipy"]
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
Expand All @@ -26,51 +22,28 @@ classifiers = [
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
]
dynamic = ["version"]

[project.urls]
repository = "https://github.com/flatironinstitute/pytorch-finufft"
homepage = "https://github.com/flatironinstitute/pytorch-finufft"

[project.optional-dependencies]
dev = ["black", "mypy", "isort", "ruff", "pytest", "pytest-cov"]

[tool.setuptools.dynamic]
version = { attr = "pytorch_finufft.__version__" }

[tool.poetry.dependencies]
python = ">=3.9,<3.12"
finufft = "^2.1.0"
torch = "^2.0.1"
numpy = "^1.24.3"
scipy = "^1.10.1"
nvidia-cublas-cu11 = { version = "11.10.3.66", platform = 'linux' }
nvidia-cuda-cupti-cu11 = { version = "11.7.101", platform = 'linux' }
nvidia-cuda-nvrtc-cu11 = { version = "11.7.99", platform = 'linux' }
nvidia-cuda-runtime-cu11 = { version = "11.7.99", platform = 'linux' }
nvidia-cudnn-cu11 = { version = "8.5.0.96", platform = 'linux' }
nvidia-cufft-cu11 = { version = "10.9.0.58", platform = 'linux' }
nvidia-curand-cu11 = { version = "10.2.10.91", platform = 'linux' }
nvidia-cusolver-cu11 = { version = "11.4.0.1", platform = 'linux' }
nvidia-cusparse-cu11 = { version = "11.7.4.91", platform = 'linux' }
nvidia-nccl-cu11 = { version = "2.14.3", platform = 'linux' }
nvidia-nvtx-cu11 = { version = "11.7.91", platform = 'linux' }
triton = { version = "2.0.0", platform = 'linux' }
[tool.setuptools.packages]
find = {}

[tool.poetry.dev-dependencies]
bandit = "^1.7.1"
black = {version = "^23.3.0", allow-prereleases = true}
darglint = "^1.8.1"
isort = {extras = ["colors"], version = "^5.10.1"}
mypy = "^1.0"
mypy-extensions = "^1.0.0"
pre-commit = "^3.3.2"
pydocstyle = "^6.1.1"
pylint = "^2.11.1"
pytest = "^7.3.1"
pyupgrade = "^3.4.0"
coverage = "^7.2.7"
coverage-badge = "^1.1.0"
pytest-html = "^3.1.1"
pytest-cov = "^4.1.0"
[tool.setuptools.package-data]
"pytorch_finufft" = ["py.typed"]

[tool.black]
# https://github.com/psf/black
target-version = ["py39"]
line-length = 80
line-length = 88
color = true

exclude = '''
/(
\.git
Expand All @@ -88,25 +61,13 @@ exclude = '''
'''

[tool.isort]
# https://github.com/timothycrosley/isort/
py_version = 39
line_length = 88

known_typing = ["typing", "types", "typing_extensions", "mypy", "mypy_extensions"]
sections = ["FUTURE", "TYPING", "STDLIB", "THIRDPARTY", "FIRSTPARTY", "LOCALFOLDER"]
include_trailing_comma = true
profile = "black"
multi_line_output = 3
indent = 4
color_output = true

[tool.mypy]
# https://mypy.readthedocs.io/en/latest/config_file.html#using-a-pyproject-toml-file
python_version = 3.9
pretty = true
show_traceback = true
color_output = true

allow_redefinition = false
check_untyped_defs = true
disallow_any_generics = true
Expand All @@ -128,17 +89,16 @@ warn_unused_ignores = true


[tool.pytest.ini_options]
# https://docs.pytest.org/en/6.2.x/customize.html#pyproject-toml
# Directories that are not visited by pytest collector:
norecursedirs =["hooks", "*.egg", ".eggs", "dist", "build", "docs", ".tox", ".git", "__pycache__"]
doctest_optionflags = ["NUMBER", "NORMALIZE_WHITESPACE", "IGNORE_EXCEPTION_DETAIL"]

# Extra options:
addopts = [
"--strict-markers",
"--tb=short",
"--doctest-modules",
"--doctest-continue-on-failure",
norecursedirs = [
"hooks",
"*.egg",
".eggs",
"dist",
"build",
"docs",
".tox",
".git",
"__pycache__",
]

[tool.coverage.run]
Expand All @@ -149,7 +109,3 @@ source = "pytorch_finufft"

[coverage.run]
branch = true

[coverage.report]
fail_under = 50
show_missing = true
17 changes: 3 additions & 14 deletions pytorch_finufft/__init__.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,6 @@
# type: ignore[attr-defined]
"""Pytorch bindings for the FINUFFT Library"""

import sys
from importlib import metadata as importlib_metadata
from . import functional, nn

from . import functional


def get_version() -> str:
try:
return importlib_metadata.version(__name__)
except importlib_metadata.PackageNotFoundError: # pragma: no cover
return "unknown"


version: str = get_version()
__all__ = ["functional", "nn"]
__version__ = "0.1.0"
Loading

0 comments on commit d8a8e4b

Please sign in to comment.