Skip to content

Commit

Permalink
replace setup.py and travis with pyproject.toml and github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
pattonw committed Feb 15, 2023
1 parent 6024991 commit a1311c4
Show file tree
Hide file tree
Showing 8 changed files with 139 additions and 57 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/black.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Python Black

on: [push, pull_request]

jobs:
lint:
name: Python Lint
runs-on: ubuntu-latest
steps:
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Setup checkout
uses: actions/checkout@master
- name: Lint with Black
run: |
pip install black
black funlib/persistence tests --diff --check
20 changes: 20 additions & 0 deletions .github/workflows/mypy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Python mypy

on: [push, pull_request]

jobs:
static-analysis:
name: Python mypy
runs-on: ubuntu-latest
steps:
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: '3.10'
- name: Setup checkout
uses: actions/checkout@v2
- name: mypy
run: |
pip install .
pip install --upgrade mypy
mypy funlib/persistence
34 changes: 34 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Publish

on:
push:
tags: ["*"]

jobs:
build-n-publish:
name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install pypa/build
run: >-
python -m
pip install
build
--user
- name: Build a binary wheel and a source tarball
run: >-
python -m
build
--sdist
--wheel
--outdir dist/
- name: Publish distribution 📦 to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
25 changes: 25 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Test

on:
push:

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

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip install ".[dev]"
- name: Test with pytest
run: |
pytest tests
27 changes: 0 additions & 27 deletions .travis.yml

This file was deleted.

41 changes: 41 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
[build-system]
build-backend = "setuptools.build_meta"
requires = ["setuptools", "wheel"]

[project]
name = "daisy"
description = "Blockwise task scheduler for processing large volumetric data."
version = "1.0"
license = {text = "MIT"}
readme = "README.md"
authors = [
{name = "William Patton", email = "[email protected]"},
{name = "Jan Funke", email = "[email protected]"},
{name = "Tri M. Nguyen", email = "[email protected]"},
{name = "Caroline Malin-Mayor", email = "[email protected]"}
]

requires-python = ">=3.7"
classifiers = [
"Programming Language :: Python :: 3",
]
keywords = []

dependencies = [
"numpy",
"tornado>=5",
"tqdm",
"funlib.math",
"funlib.geometry",
]

[project.optional-dependencies]
dev = [
"pytest",
"black",
"mypy",
"filelock",
]

[tool.black]
target_version = ['py36', 'py37', 'py38', 'py39', 'py310']
5 changes: 0 additions & 5 deletions requirements_dev.txt

This file was deleted.

25 changes: 0 additions & 25 deletions setup.py

This file was deleted.

0 comments on commit a1311c4

Please sign in to comment.