-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Modernize package and prepare release
- Loading branch information
Showing
10 changed files
with
198 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: Test on Ubuntu | ||
|
||
on: | ||
pull_request: | ||
branches: [dev] | ||
types: [synchronize, opened, reopened] | ||
|
||
|
||
jobs: | ||
build-and-test: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.10" | ||
- name: Install package | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install .[test] | ||
- name: Pytest | ||
run: | | ||
pytest -v |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: Release to PyPI | ||
|
||
on: | ||
push: | ||
tags: | ||
- '*' | ||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python 3.10 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.10" | ||
- name: Install Tools | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install setuptools wheel twine build | ||
- name: Package and Upload | ||
env: | ||
STACKMANAGER_VERSION: ${{ github.event.release.tag_name }} | ||
TWINE_USERNAME: __token__ | ||
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} | ||
run: | | ||
python -m build --sdist --wheel | ||
twine upload dist/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.5.0 | ||
hooks: | ||
- id: fix-encoding-pragma | ||
exclude: tests/test_data | ||
- id: trailing-whitespace | ||
exclude: tests/test_data | ||
- id: end-of-file-fixer | ||
exclude: tests/test_data | ||
- id: check-docstring-first | ||
- id: debug-statements | ||
- id: check-toml | ||
- id: check-yaml | ||
exclude: tests/test_data | ||
- id: requirements-txt-fixer | ||
- id: detect-private-key | ||
- id: check-merge-conflict | ||
|
||
- repo: https://github.com/psf/black | ||
rev: 24.4.2 | ||
hooks: | ||
- id: black | ||
exclude: tests/test_data | ||
- id: black-jupyter | ||
|
||
- repo: https://github.com/pycqa/isort | ||
rev: 5.13.2 | ||
hooks: | ||
- id: isort | ||
args: ["--profile", "black"] | ||
|
||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
rev: v0.4.4 | ||
hooks: | ||
- id: ruff |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
[project] | ||
name = "head_direction" | ||
version = "0.1.0" | ||
authors = [ | ||
{ name = "Mikkel Lepperod", email = "[email protected]" }, | ||
{ name = "Alessio Buccino", email = "[email protected]" }, | ||
] | ||
|
||
description = "Compute spatial maps for neural data." | ||
readme = "README.md" | ||
requires-python = ">=3.10" | ||
classifiers = [ | ||
"Programming Language :: Python :: 3", | ||
"License :: OSI Approved :: MIT License", | ||
"Operating System :: OS Independent", | ||
] | ||
|
||
dependencies = [ | ||
"numpy<2", | ||
"scipy", | ||
"astropy", | ||
"pycircstat", | ||
"pandas", | ||
"elephant", | ||
"matplotlib", | ||
"nose" | ||
] | ||
|
||
[project.urls] | ||
homepage = "https://github.com/CINPLA/head-directopm" | ||
repository = "https://github.com/CINPLA/head-direction" | ||
|
||
[build-system] | ||
requires = ["setuptools>=62.0"] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[tool.setuptools] | ||
include-package-data = true | ||
|
||
[tool.setuptools.packages.find] | ||
where = ["src"] | ||
include = ["head_direction*"] | ||
namespaces = false | ||
|
||
[project.optional-dependencies] | ||
dev = ["pre-commit", "black[jupyter]", "isort", "ruff"] | ||
test = ["pytest", "pytest-cov", "pytest-dependency", "mountainsort5"] | ||
docs = ["sphinx-gallery", "sphinx_rtd_theme"] | ||
full = [ | ||
"head_direction[dev]", | ||
"head_direction[test]", | ||
"head_direction[docs]", | ||
] | ||
|
||
[tool.coverage.run] | ||
omit = ["tests/*"] | ||
|
||
[tool.black] | ||
line-length = 120 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,6 @@ | ||
# -*- coding: utf-8 -*- | ||
from setuptools import setup | ||
import os | ||
|
||
from setuptools import setup, find_packages | ||
import setuptools | ||
|
||
long_description = open("README.md").read() | ||
|
||
install_requires = [ | ||
'numpy>=1.9', | ||
'scipy', | ||
'astropy', | ||
'pandas>=0.14.1', | ||
'elephant', | ||
'matplotlib'] | ||
extras_require = { | ||
'testing': ['pytest'], | ||
'docs': ['numpydoc>=0.5', | ||
'sphinx>=1.2.2', | ||
'sphinx_rtd_theme'] | ||
} | ||
|
||
setup( | ||
name="head_direction", | ||
install_requires=install_requires, | ||
tests_require=install_requires, | ||
extras_require=extras_require, | ||
packages=find_packages(), | ||
include_package_data=True, | ||
version='0.1', | ||
) | ||
if __name__ == "__main__": | ||
setuptools.setup() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# -*- coding: utf-8 -*- | ||
import head | ||
|
||
__all__ = ["head"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters