-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20 from CINPLA/modernize
Modernize package and add actions
- Loading branch information
Showing
21 changed files
with
481 additions
and
424 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
[project] | ||
name = "spatial_maps" | ||
version = "0.2.0" | ||
authors = [ | ||
{ name = "Mikkel Lepperod", email = "mikkel@simula.no" }, | ||
{ name = "Alessio Buccino", email = "alessiop.buccino@gmail.com" }, | ||
] | ||
|
||
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", | ||
"scikit-image", | ||
"astropy", | ||
"pandas", | ||
"elephant", | ||
"matplotlib" | ||
] | ||
|
||
[project.urls] | ||
homepage = "https://github.com/CINPLA/spatial-maps" | ||
repository = "https://github.com/CINPLA/spatial-maps" | ||
|
||
[build-system] | ||
requires = ["setuptools>=62.0"] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[tool.setuptools] | ||
include-package-data = true | ||
|
||
[tool.setuptools.packages.find] | ||
where = ["src"] | ||
include = ["spatial_maps*"] | ||
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 = [ | ||
"spatial_maps[dev]", | ||
"spatial_maps[test]", | ||
"spatial_maps[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="spatial_maps", | ||
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() |
Oops, something went wrong.