generated from edeno/package_template
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
152 additions
and
33 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,4 @@ | ||
node: $Format:%H$ | ||
node-date: $Format:%cI$ | ||
describe-name: $Format:%(describe:tags=true,match=*[0-9]*)$ | ||
ref-names: $Format:%D$ |
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,2 +1,7 @@ | ||
linguist-language=python | ||
notebooks/* linguist-vendored | ||
|
||
# Auto detect text files and perform LF normalization | ||
* text=auto | ||
|
||
.git_archival.txt export-subst |
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 |
---|---|---|
|
@@ -91,3 +91,5 @@ coverage.xml | |
.DS_Store | ||
*.png | ||
*.mp4 | ||
|
||
_version.py |
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,6 +1,13 @@ | ||
{ | ||
"[python]": { | ||
"editor.defaultFormatter": "ms-python.black-formatter" | ||
"editor.defaultFormatter": "ms-python.black-formatter", | ||
"editor.formatOnSave": true, | ||
"editor.codeActionsOnSave": { | ||
"source.organizeImports": "explicit" | ||
}, | ||
}, | ||
"python.formatting.provider": "none" | ||
"isort.args": [ | ||
"--profile", | ||
"black" | ||
], | ||
} |
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,38 @@ | ||
[build-system] | ||
requires = ["hatchling", "hatch-vcs"] | ||
build-backend = "hatchling.build" | ||
|
||
[project] | ||
name = "track_linearization" | ||
description = "A python package to map 2D trajectories to 1D." | ||
readme = "README.md" | ||
requires-python = ">=3.8" | ||
license = { file = "LICENSE" } | ||
authors = [{ name = "Eric Denovellis", email = "[email protected]" }] | ||
classifiers = [ | ||
"Programming Language :: Python :: 3", | ||
"License :: OSI Approved :: MIT License", | ||
"Operating System :: OS Independent", | ||
] | ||
dependencies = ["numpy", "scipy", "matplotlib", "pandas", "dask", "networkx"] | ||
dynamic = ["version"] | ||
|
||
[project.urls] | ||
"Homepage" = "https://github.com/LorenFrankLab/track_linearization" | ||
"Bug Tracker" = "https://github.com/LorenFrankLab/track_linearization/issues" | ||
|
||
[project.optional-dependencies] | ||
test = ["black", "pytest", "pytest-cov"] | ||
opt = ["numba", "ipympl"] | ||
|
||
[tool.hatch.version] | ||
source = "vcs" | ||
|
||
[tool.hatch.build.hooks.vcs] | ||
version-file = "src/track_linearization/_version.py" | ||
|
||
[tool.hatch.build.targets.sdist] | ||
exclude = [".git_archival.txt"] | ||
|
||
[tool.hatch.build.targets.wheel] | ||
packages = ["src/track_linearization"] |
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,94 @@ | ||
name: Test building package and publish | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- maint/* | ||
tags: | ||
- "*" | ||
pull_request: | ||
branches: | ||
- main | ||
- maint/* | ||
defaults: | ||
run: | ||
shell: bash | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.10" | ||
- run: pip install --upgrade build twine | ||
- name: Build sdist and wheel | ||
run: python -m build | ||
- run: twine check dist/* | ||
- name: Upload sdist and wheel artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: dist | ||
path: dist/ | ||
- name: Build git archive | ||
run: mkdir archive && git archive -v -o archive/archive.tgz HEAD | ||
- name: Upload git archive artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: archive | ||
path: archive/ | ||
test-package: | ||
runs-on: ubuntu-latest | ||
needs: [build] | ||
strategy: | ||
matrix: | ||
package: ['wheel', 'sdist', 'archive'] | ||
steps: | ||
- name: Download sdist and wheel artifacts | ||
if: matrix.package != 'archive' | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: dist | ||
path: dist/ | ||
- name: Download git archive artifact | ||
if: matrix.package == 'archive' | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: archive | ||
path: archive/ | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.10" | ||
- name: Display Python version | ||
run: python -c "import sys; print(sys.version)" | ||
- name: Update pip | ||
run: pip install --upgrade pip | ||
- name: Install wheel | ||
if: matrix.package == 'wheel' | ||
run: pip install dist/*.whl | ||
- name: Install sdist | ||
if: matrix.package == 'sdist' | ||
run: pip install dist/*.tar.gz | ||
- name: Install archive | ||
if: matrix.package == 'archive' | ||
run: pip install archive/archive.tgz | ||
- name: Install test extras | ||
run: pip install package_name[test] | ||
- name: Run tests | ||
run: pytest --doctest-modules -v --pyargs track_linearization | ||
publish: | ||
runs-on: ubuntu-latest | ||
needs: [test-package] | ||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') | ||
steps: | ||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: dist | ||
path: dist/ | ||
- uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.PYPI_API_TOKEN }} |