Skip to content

Commit

Permalink
Add boilerplate
Browse files Browse the repository at this point in the history
Fixes most of #1 [ branch restrictions needs to be done in repo settings ]
  • Loading branch information
e-lo committed Apr 21, 2021
0 parents commit 650fd81
Show file tree
Hide file tree
Showing 35 changed files with 1,224 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
name: Bug report
about: Create a report to help us improve
title: "[BUG] Description of problem"
labels: bug
assignees: ''

---

## Describe the bug
A clear and concise description of what the bug is or the error code you got. e.g.
```python
KeyError: 'Passing list-likes to .loc or [] with any missing labels is no longer supported, see https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#deprecate-loc-reindex-listlike'
```

## To Reproduce
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

### Failing tests
- [ ] No applicable test failed, need to create.
- [ ]

### Triggering line of code


### Thoughts on resolution

### Full stack trace


### Environment

Operating system:
Context (conda, jupyter, etc):
Environment (e.g. output from `conda list`):
32 changes: 32 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
name: Feature request
about: Suggest an idea for this project
title: "[FEATURE]"
labels: enhancement
assignees: ''

---

### User Story
*As a ...insert type of user... I'd like to ...insert desired feature or behavior...*

### Priority

### Level of Effort

### Resolution Ideas

### Project
*Is there a funder or project associated with this feature?*

### Who should be involved?
Implementer:
Commenters:
Users:
Reviewers:

### Risk
*Will this potentially break anything?*

#### Tests
*What are relevant tests or what tests need to be created in order to determine that this issue is complete?*
27 changes: 27 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
## What existing problem does the pull request solve and why should we include it?


## What is the testing plan?

*Demonstrate the code is solid by discussing how results are verified and covered by tests*

- [ ] Code for this PR is covered in tests
- [ ] Code passes all existing tests

## Code formatting
*Code should be PEP8 compliant before merging by running a package like [`black`](https://pypi.org/project/black/)*

- [ ] Code linted

## Applicable Issues
*Please do not create a Pull Request without creating an issue first.*

*Put `closes #XXXX` in your comment to auto-close the issue that your PR fixes.*


#### Issues List

- closes...
- closes...


43 changes: 43 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# This workflow will upload a Python Package using Twine when a release is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries

name: Upload Python Package

on:
release:
types: [created]

jobs:

deploy:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.7'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
- name: Build Sphinx docs
run: |
cd docs
make html
- name: Deploy
if: success()
uses: peaceiris/actions-gh-pages@v3
with:
publish_branch: gh-pages
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: _build/html/
35 changes: 35 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Python package

on: [push]

jobs:
build:

runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7, 3.8]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r dev-requirements.txt
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Install package
run: |
pip install -e .[test]
- name: Test with pytest
run: |
pytest -s -m "not skipci"
122 changes: 122 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# System Errata
.DS_Store
.DS_Store?

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
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

# Logs
pip-log.txt
pip-delete-this-directory.txt
*.log
# except logs in the example
!examples/**/*.log

#temp files
tests/scratch/*
!tests/scratch/readme.md
scratch/*
.temp
.pytest_cache
*.bak
.cache
.hubstorinfo

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

# Translations
*.mo
*.pot

# Sphinx documentation
docs/_build/
docs/_generated/*
docs/_autosummary/*

# Jupyter
.ipynb_checkpoints
profile_default/
ipython_config.py

# pyenv
.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

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

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

# IDE files
.idea
.spyderproject
.spyproject
.project
.pydevproject
.settings
.vscode

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

# Pyre type checker
.pyre/
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Changelog

## Version (date)
- a list
- of things
- that have changed
2 changes: 2 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Contribution Guide

31 changes: 31 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# docker build -t mypackage .
# docker run --rm -v "$PWD":/home/jovyan/work mypackage /bin/bash
FROM jupyter/minimal-notebook

COPY ../requirements.txt /tmp/requirements.txt

# configure conda and install packages in one RUN to keep image tidy
RUN conda config --set show_channel_urls true && \
conda config --set channel_priority strict && \
conda config --prepend channels conda-forge && \
conda update --yes -n base conda && \
conda install --update-all --force-reinstall --yes --file /tmp/requirements.txt

#RUN rm -f -r -v /opt/conda/share/jupyter/kernels/python3 && \
# python -m ipykernel install &&

COPY . /tmp/src
RUN pip install /tmp/src

RUN conda clean --all --yes && \
conda info --all && \
conda list && \
jupyter kernelspec list && \
ipython -c "import tm2py; print('Installed version: ', tm2py.__version__)"

# copy default jupyterlab settings, then set jupyter working directory to map to mounted volume
# COPY overrides.json /opt/conda/share/jupyter/lab/settings/
WORKDIR /home/jovyan/work

# set default command to launch when container is run
CMD ["jupyter", "lab", "--ip='0.0.0.0'", "--port=8888", "--no-browser", "--NotebookApp.token=''", "--NotebookApp.password=''"]
Loading

0 comments on commit 650fd81

Please sign in to comment.