Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

Commit

Permalink
Repo structure (#121)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielfrg committed May 8, 2020
1 parent 6e28921 commit 93a1b9a
Show file tree
Hide file tree
Showing 39 changed files with 1,114 additions and 518 deletions.
9 changes: 9 additions & 0 deletions .coveragerc
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/*
51 changes: 51 additions & 0 deletions .github/workflows/test.yml
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

112 changes: 95 additions & 17 deletions .gitignore
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
7 changes: 7 additions & 0 deletions .isort.cfg
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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# pelican-jupyter Change Log

## [Unreleased]

-
21 changes: 21 additions & 0 deletions DEVELOP.md
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.
99 changes: 99 additions & 0 deletions Makefile
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
Loading

0 comments on commit 93a1b9a

Please sign in to comment.