Skip to content

Commit

Permalink
268 switch to hatch (#273)
Browse files Browse the repository at this point in the history
* Switched to Hatch, removed old files, working through lints

* Fixed most, suppressed more

* Fixed license
  • Loading branch information
kjy5 authored Dec 14, 2023
1 parent 251712b commit 4cae767
Show file tree
Hide file tree
Showing 33 changed files with 295 additions and 1,561 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/autoformat-and-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ jobs:
python-version: '3.12'
cache: 'pip'

- name: 📦 Install dependencies
run: pip install .[dev]
- name: 📦 Install Hatch
run: pip install hatch

- name: 📝 Format Code
run: ruff format .
run: hatch fmt -f

- name: ✅ Commit code format changes
if: github.event.pull_request.user.login != 'dependabot[bot]'
Expand All @@ -44,4 +44,4 @@ jobs:
commit_message: "Autoformat code"

- name: 🔍 Lint
run: ruff check .
run: hatch fmt --check
2 changes: 0 additions & 2 deletions .isort.cfg

This file was deleted.

1 change: 0 additions & 1 deletion MANIFEST.in

This file was deleted.

1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
[![PyPI version](https://badge.fury.io/py/ephys-link.svg)](https://badge.fury.io/py/ephys-link)
[![CodeQL](https://github.com/VirtualBrainLab/ephys-link/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/VirtualBrainLab/ephys-link/actions/workflows/codeql-analysis.yml)
[![Dependency Review](https://github.com/VirtualBrainLab/ephys-link/actions/workflows/dependency-review.yml/badge.svg)](https://github.com/VirtualBrainLab/ephys-link/actions/workflows/dependency-review.yml)
[![Hatch project](https://img.shields.io/badge/%F0%9F%A5%9A-Hatch-4051b5.svg)](https://github.com/pypa/hatch)
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)

<img width="100%" src="https://github.com/VirtualBrainLab/ephys-link/assets/82800265/c89e433c-2ce0-4f27-aa9d-66f89c59c979" alt="Manipulator and probe in pinpoint moving in sync">
Expand Down
95 changes: 73 additions & 22 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,20 +1,26 @@
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"
requires = ["hatchling"]
build-backend = "hatchling.build"

[project]
name = "ephys-link"
version = "1.0.5"
license = { file = "LICENSE" }

authors = [{ name = "Kenneth Yang", email = "[email protected]" }]
maintainers = [{ name = "Kenneth Yang", email = "[email protected]" }]

dynamic = ["version"]
description = "A Python Socket.IO server that allows any Socket.IO-compliant application to communicate with manipulators used in electrophysiology experiments."
readme = "README.md"

requires-python = ">=3.8, <3.13"
license = "GPL-3.0-only"
keywords = ["socket-io", "manipulator", "electrophysiology", "ephys", "sensapex", "neuroscience", "neurotech", "virtualbrainlab", "new-scale"]
authors = [{ name = "Kenneth Yang", email = "[email protected]" }]
maintainers = [{ name = "Kenneth Yang", email = "[email protected]" }]
classifiers = [
"Programming Language :: Python",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Programming Language :: Python :: 3",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Operating System :: OS Independent",
Expand All @@ -23,8 +29,6 @@ classifiers = [
"Intended Audience :: Science/Research",
"Topic :: Scientific/Engineering :: Medical Science Apps.",
]

requires-python = ">=3.8, <3.13"
dependencies = [
"aiohttp==3.9.1",
"pyserial==3.5",
Expand All @@ -34,20 +38,67 @@ dependencies = [
"sensapex==1.400.0",
]

[project.optional-dependencies]
dev = [
"build",
"ruff",
"twine",
"setuptools",
]

[project.urls]
"GitHub" = "https://github.com/VirtualBrainLab/ephys-link"
Documentation = "https://virtualbrainlab.org/ephys_link/installation_and_use.html"
"Issue Tracker" = "https://github.com/VirtualBrainLab/ephys-link/issues"
Issues = "https://github.com/VirtualBrainLab/ephys-link/issues"
Source = "https://github.com/VirtualBrainLab/ephys-link"

[project.scripts]
ephys-link = "ephys_link.__main__:main"
ephys_link = "ephys_link.__main__:main"
el = "ephys_link.__main__:main"
el = "ephys_link.__main__:main"

[tool.hatch.version]
path = "src/ephys_link/__about__.py"

[tool.hatch.build.targets.sdist]
exclude = ["/.github", "/.idea"]

[tool.hatch.envs.default]
dependencies = [
"coverage[toml]>=6.5",
"pytest",
]
[tool.hatch.envs.default.scripts]
test = "pytest {args:tests}"
test-cov = "coverage run -m pytest {args:tests}"
cov-report = [
"- coverage combine",
"coverage report",
]
cov = [
"test-cov",
"cov-report",
]

[[tool.hatch.envs.all.matrix]]
python = ["3.8", "3.9", "3.10", "3.11", "3.12"]

[tool.hatch.envs.types]
dependencies = [
"mypy>=1.0.0",
]
[tool.hatch.envs.types.scripts]
check = "mypy --install-types --non-interactive {args:src/ephys_link tests}"

[tool.coverage.run]
source_pkgs = ["ephys_link", "tests"]
branch = true
parallel = true
omit = [
"src/ephys_link/__about__.py",
]

[tool.coverage.paths]
ephys_link = ["src/ephys_link", "*/ephys-link/src/ephys_link"]
tests = ["tests", "*/ephys-link/tests"]

[tool.coverage.report]
exclude_lines = [
"no cov",
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
]

[tool.ruff.lint]
extend-ignore = ["T201", "PLW0603", "BLE001", "FBT001", "ARG002", "S310"]
26 changes: 0 additions & 26 deletions scripts/drive_test.py

This file was deleted.

63 changes: 0 additions & 63 deletions scripts/new_scale_move.py

This file was deleted.

85 changes: 0 additions & 85 deletions scripts/probe_crash_test.py

This file was deleted.

Loading

0 comments on commit 4cae767

Please sign in to comment.