This repository has been archived by the owner on Apr 6, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 105
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
39 changed files
with
1,114 additions
and
518 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,9 @@ | ||
[run] | ||
omit = | ||
pelican_jupyter/tests/* | ||
source = | ||
pelican_jupyter | ||
|
||
[report] | ||
omit = | ||
pelican_jupyter/tests/* |
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,51 @@ | ||
name: test | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
python-version: [3.6, 3.7, 3.8] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- run: git fetch --prune --unshallow | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r requirements.txt | ||
pip freeze | ||
- name: Install package | ||
run: | | ||
make build | ||
pip install dist/*.tar.gz | ||
pip freeze | ||
- name: Check linting | ||
run: | | ||
make check | ||
- name: Run tests | ||
if: always() | ||
run: | | ||
make test | ||
- name: Codecov | ||
uses: codecov/codecov-action@v1 | ||
with: | ||
file: ./coverage.xml | ||
|
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,35 +1,113 @@ | ||
### Python ### | ||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
*.py[cod] | ||
*$py.class | ||
|
||
# C extensions | ||
*.so | ||
|
||
# Packages | ||
*.egg | ||
*.egg-info | ||
dist | ||
build | ||
eggs | ||
parts | ||
bin | ||
var | ||
sdist | ||
develop-eggs | ||
# 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 | ||
lib | ||
lib64 | ||
*.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 | ||
.tox | ||
.coverage.* | ||
.cache | ||
nosetests.xml | ||
coverage.xml | ||
*.cover | ||
.hypothesis/ | ||
.pytest_cache/ | ||
|
||
# Translations | ||
*.mo | ||
*.pot | ||
|
||
# Scrapy stuff: | ||
.scrapy | ||
|
||
# Sphinx documentation | ||
docs/_build/ | ||
|
||
# PyBuilder | ||
target/ | ||
|
||
# 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 | ||
|
||
# celery beat schedule file | ||
celerybeat-schedule | ||
|
||
# Pelican/Jupyter | ||
output/ | ||
cache/ | ||
# SageMath parsed files | ||
*.sage.py | ||
|
||
# Spyder project settings | ||
.spyderproject | ||
.spyproject | ||
|
||
# Rope project settings | ||
.ropeproject | ||
|
||
# Mr Developer | ||
.mr.developer.cfg | ||
.project | ||
.pydevproject | ||
|
||
# mkdocs documentation | ||
/site | ||
|
||
# mypy | ||
.mypy_cache/ | ||
.dmypy.json | ||
dmypy.json | ||
|
||
# Pyre type checker | ||
.pyre/ | ||
|
||
# Jupyter Notebook | ||
.ipynb_checkpoints | ||
|
||
# setuptools_scm | ||
_generated_version.py | ||
|
||
### Project specific ### | ||
pelican_jupyter/tests/pelican/output |
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,7 @@ | ||
# https://black.readthedocs.io/en/stable/the_black_code_style.html#how-black-wraps-lines | ||
[settings] | ||
multi_line_output=3 | ||
include_trailing_comma=True | ||
force_grid_wrap=0 | ||
use_parentheses=True | ||
line_length=88 |
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,5 @@ | ||
# pelican-jupyter Change Log | ||
|
||
## [Unreleased] | ||
|
||
- |
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,21 @@ | ||
# Development | ||
|
||
Create dev environment | ||
|
||
``` | ||
# Create conda env | ||
make env | ||
conda activate pelican-jupyter | ||
make develop | ||
``` | ||
|
||
## Testing | ||
|
||
``` | ||
# Check linting and format | ||
make check | ||
make fmt | ||
# Run tests | ||
make test | ||
``` |
File renamed without changes.
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,99 @@ | ||
SHELL := bash | ||
.ONESHELL: | ||
.SHELLFLAGS := -eu -o pipefail -c | ||
.DELETE_ON_ERROR: | ||
MAKEFLAGS += --warn-undefined-variables | ||
MAKEFLAGS += --no-builtin-rules | ||
|
||
PWD := $(shell pwd) | ||
TEST_FILTER ?= "" | ||
|
||
|
||
first: help | ||
|
||
.PHONY: clean | ||
clean: ## Clean build files | ||
@rm -rf build dist site htmlcov .pytest_cache .eggs | ||
@rm -f .coverage coverage.xml pelican_jupyter/_generated_version.py | ||
@find . -type f -name '*.py[co]' -delete | ||
@find . -type d -name __pycache__ -exec rm -rf {} + | ||
@find . -type d -name .ipynb_checkpoints -exec rm -rf {} + | ||
@rm -rf pelican_jupyter/tests/pelican/output | ||
|
||
|
||
.PHONY: cleanall | ||
cleanall: clean ## Clean everything | ||
@rm -rf *.egg-info | ||
|
||
|
||
.PHONY: help | ||
help: ## Show this help menu | ||
@grep -E '^[0-9a-zA-Z_-]+:.*?##.*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?##"; OFS="\t\t"}; {printf "\033[36m%-30s\033[0m %s\n", $$1, ($$2==""?"":$$2)}' | ||
|
||
|
||
# ------------------------------------------------------------------------------ | ||
# Package build, test and docs | ||
|
||
.PHONY: env ## Create dev environment | ||
env: | ||
conda env create | ||
|
||
|
||
.PHONY: develop | ||
develop: ## Install package for development | ||
python -m pip install --no-build-isolation -e . | ||
|
||
|
||
.PHONY: build | ||
build: package ## Build everything | ||
|
||
|
||
.PHONY: package | ||
package: ## Build Python package (sdist) | ||
python setup.py sdist | ||
|
||
|
||
.PHONY: check | ||
check: ## Check linting | ||
@flake8 | ||
@isort --check-only --diff --recursive --project pelican_jupyter --section-default THIRDPARTY pelican_jupyter . | ||
@black --check pelican_jupyter . | ||
|
||
|
||
.PHONY: fmt | ||
fmt: ## Format source | ||
@isort --recursive --project pelican_jupyter --section-default THIRDPARTY pelican_jupyter . | ||
@black pelican_jupyter . | ||
|
||
|
||
.PHONY: upload-pypi | ||
upload-pypi: ## Upload package to PyPI | ||
twine upload dist/*.tar.gz | ||
|
||
|
||
.PHONY: upload-test | ||
upload-test: ## Upload package to test PyPI | ||
twine upload --repository testpypi dist/*.tar.gz | ||
|
||
|
||
.PHONY: test | ||
test: ## Run tests | ||
pytest -s -vv pelican_jupyter/tests -k $(TEST_FILTER) | ||
|
||
|
||
.PHONY: docs | ||
docs: ## Build mkdocs | ||
mkdocs build --config-file $(CURDIR)/mkdocs.yml | ||
|
||
|
||
.PHONY: serve-docs | ||
serve-docs: ## Serve docs | ||
mkdocs serve | ||
|
||
|
||
.PHONY: netlify | ||
netlify: ## Build docs on Netlify | ||
$(MAKE) docs | ||
|
||
# ------------------------------------------------------------------------------ | ||
# Project specific |
Oops, something went wrong.