Skip to content

Commit

Permalink
Init
Browse files Browse the repository at this point in the history
  • Loading branch information
bjhardcastle committed Feb 1, 2024
0 parents commit c91c29b
Show file tree
Hide file tree
Showing 25 changed files with 3,720 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .copier-answers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Changes here will be overwritten by Copier
_commit: 69236c7
_src_path: gh:alleninstitute/copier-pdm-npc
add_requirements_txt: true
author_email: [email protected]
author_fullname: Ben Hardcastle
author_username: bjhardcastle
build_doc: true
copyright_date: '2024'
copyright_holder: Allen Institute for Neural Dynamics
copyright_holder_email: ''
copyright_license: MIT
package_version: 0.1.0
project_description: Tools for accessing and processing stim data, compatible with
data in the cloud.
project_name: npc_stim
python_package_distribution_name: npc-stim
python_package_import_name: npc_stim
python_package_requires_python: '>=3.9'
repository_name: npc_stim
repository_namespace: AllenInstitute

38 changes: 38 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Build docs

on:
push:
paths:
- "**.md"
- docs/**
- .github/workflows/docs.yml
tags:
- '*'
release:
types: [published]
workflow_dispatch:


concurrency:
group: ${{ '{{' }} github.ref {{ '}}' }}


jobs:
build-doc:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: pdm-project/setup-pdm@main
with:
python-version: 3.x
cache: true
- name: Build pages
run: |
pdm install -G docs
cd docs && pdm run mkdocs build
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ '{{' }} secrets.GITHUB_TOKEN {{ '}}' }}
publish_dir: ./docs/site
99 changes: 99 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
# This workflow will install Python dependencies, run tests and lint/formatting - possibly with a variety of Python versions - bump version, re-commit publish to PYPI
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: Publish Python package

on:
push:
branches: [ "main" ]
paths: # pushing any files/folders marked ! will not trigger the workflow
- '**'
- '!**.ipynb'
- '!**.json'
- '!.vscode'
- '!scripts/**'
- '!tests/**'
- '!notebooks/**'
- '!**.md'
- '!**.yml'
- '.github/workflows/publish.yml'
workflow_dispatch: # adds a 'Run Workflow' button for manual launching

concurrency: # jobs currently running will be cancelled when this workflow starts
group: ${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}

jobs:
test:

runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
python-version: ["3.9", "3.11"]
os: [ubuntu-latest, macOS-latest, windows-latest]
permissions: write-all

steps:
- uses: actions/checkout@v4
env:
GITHUB_TOKEN: ${{ secrets.PAT }}
# use PAT, or push comes from `github-actions` bot, which can't trigger
# other workflows

- uses: pdm-project/setup-pdm@v4
with:
python-version: ${{ matrix.python-version }}
update-python: true
cache: true # speeds-up setup by caching downloaded packages

- name: Install dependencies
run: |
pdm install -G dev
- name: Test, format, lint
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
DBHUB_API_KEY: ${{ secrets.DBHUB_API_KEY }}
CODE_OCEAN_API_TOKEN: ${{ secrets.CODE_OCEAN_API_TOKEN }}
CODE_OCEAN_DOMAIN: ${{ secrets.CODE_OCEAN_DOMAIN }}
run: |
mkdir .mypy_cache
pdm run test
publish:
needs: test
runs-on: ubuntu-latest
permissions: write-all

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # get all commits (on default branch)
fetch-tags: true

- uses: pdm-project/setup-pdm@v4
with:
python-version: '3.11'
cache: true # speeds-up setup by caching downloaded packages

- name: Publish with bump & tag
# actions/checkout
run: |
pdm install -G dev
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
git config --global user.name "${{ github.actor }}"
pdm publish
git push
git push --tags
env:
GITHUB_TOKEN: ${{ secrets.PAT }}
# use PAT, or push comes from `github-actions` bot, which can't trigger
# other workflows

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
168 changes: 168 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/#use-with-ide
.pdm.toml
.pdm-python
.pdm-build/

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/

*.sqlite
.misc
.ruff_cache

.sandbox.py
11 changes: 11 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"recommendations": [
"ms-python.python",
"ms-python.vscode-pylance",
"ms-python.black-formatter",
"ms-python.mypy-type-checker",
"donjayamanne.python-environment-manager",
"ms-toolsai.jupyter",
"eamodio.gitlens"
]
}
7 changes: 7 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"python.linting.mypyEnabled": true,
"python.linting.enabled": true,
"python.linting.pylintEnabled": false,
"python.analysis.inlayHints.functionReturnTypes": true,
"python.analysis.typeCheckingMode": "off"
}
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Changelog

<!-- insertion marker -->
Loading

0 comments on commit c91c29b

Please sign in to comment.