Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

migrate to latest template #54

Merged
merged 5 commits into from
Apr 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 0 additions & 25 deletions .bumpversion.cfg

This file was deleted.

30 changes: 22 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: [3.9]
node-version: [12.x]
node-version: [14.x]
event-name: [push]

steps:
Expand All @@ -39,22 +39,25 @@ jobs:

- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel twine
python -m pip install -e .[dev]
cd js; yarn
make develop

- name: Build
run: |
make build

- name: Lint
run: |
make lint

- name: Test
- name: Checks
run: |
make tests
make checks
if: ${{ github.event_name == matrix.event-name || matrix.os == 'ubuntu-latest' }}

- name: Twine check
- name: Test
run: |
make dist
make tests
if: ${{ github.event_name == matrix.event-name || matrix.os == 'ubuntu-latest' }}

- name: Upload test results
uses: actions/upload-artifact@v2
Expand All @@ -63,5 +66,16 @@ jobs:
path: python_junit.xml
if: ${{ always() }}

- name: Publish Unit Test Results
uses: EnricoMi/publish-unit-test-result-action@v1
with:
files: python_junit.xml
if: ${{ matrix.os == 'ubuntu-latest' }}

- name: Upload coverage
uses: codecov/codecov-action@v1

- name: Twine check
run: |
make dist

4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -171,4 +171,6 @@ docs/index.md
python_junit.xml
Untitled*.ipynb
Untitled*.html
output*.png
output*.png
jupyterlab_email/labextension

13 changes: 0 additions & 13 deletions .readthedocs.yml

This file was deleted.

23 changes: 15 additions & 8 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,27 +1,34 @@
include LICENSE
include README.md
include CODE_OF_CONDUCT.md
include CONTRIBUTING.md

include requirements.txt
include setup.cfg
include pyproject.toml
include .bumpversion.cfg
include Makefile

include jupyterlab_commands/extension/jupyterlab_commands.json
recursive-include jupyterlab_email/templates *

# grab js
graft js
prune docs
prune js/lib
prune js/build
prune js/coverage
prune js/dist
prune js/yarn.lock
prune js/docs
prune js/lib
prune js/node_modules
prune js/package-lock.json
prune js/yarn.lock

# Get rid of docs
prune docs

# get rid of binder
prune binder

# Patterns to exclude from any directory
global-exclude *~
global-exclude *.pyc
global-exclude *.pyo
global-exclude .git
global-exclude .ipynb_checkpoints
global-exclude .DS_Store

78 changes: 46 additions & 32 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,54 +1,68 @@
testpy: ## Clean and Make unit tests
python -m pytest -v jupyterlab_email/tests --cov=jupyterlab_email --junitxml=python_junit.xml --cov-report=xml --cov-branch

testjs: ## Clean and Make js tests
cd js; yarn test

testpy: ## Clean and Make unit tests
python -m pytest -v jupyterlab_email/tests --cov=jupyterlab_email
test: tests
tests: testpy testjs ## run the tests

tests: lint ## run the tests
python -m pytest -v jupyterlab_email/tests --cov=jupyterlab_email --junitxml=python_junit.xml --cov-report=xml --cov-branch
cd js; yarn test
lintpy: ## Black/flake8 python
python -m black --check jupyterlab_email setup.py docs/conf.py
python -m flake8 jupyterlab_email setup.py docs/conf.py

lint: ## run linter
python -m flake8 jupyterlab_email setup.py
lintjs: ## ESlint javascript
cd js; yarn lint

fix: ## run autopep8/tslint fix
python -m black jupyterlab_email/ setup.py
cd js; yarn fix
lint: lintpy lintjs ## run linter

clean: ## clean the repository
find . -name "__pycache__" | xargs rm -rf
find . -name "*.pyc" | xargs rm -rf
find . -name ".ipynb_checkpoints" | xargs rm -rf
rm -rf .coverage coverage cover htmlcov logs build dist *.egg-info lib node_modules
# make -C ./docs clean
fixpy: ## Black python
python -m black jupyterlab_email/ setup.py docs/conf.py

docs: ## make documentation
make -C ./docs html
open ./docs/_build/html/index.html
fixjs: ## ESlint Autofix JS
cd js; yarn fix

install: ## install to site-packages
python -m pip install .
fix: fixpy fixjs ## run black/tslint fix

check: checks
checks: ## run lint and other checks
check-manifest

serverextension: install ## enable serverextension
python -m jupyter serverextension enable --py jupyterlab_email
build: clean ## build python/javascript
python -m build .

js: ## build javascript
develop: ## install to site-packages in editable mode
python -m pip install --upgrade build pip setuptools twine wheel
cd js; yarn
cd js; yarn build
python -m pip install -e .[develop]

labextension: js ## enable labextension
cd js; python -m jupyter labextension install .
install: ## install to site-packages
python -m pip install .

dist: js ## create dists
rm -rf dist build
python setup.py sdist bdist_wheel
dist: clean build ## create dists
python -m twine check dist/*

publish: dist ## dist to pypi and npm
publishpy: ## dist to pypi
python -m twine upload dist/* --skip-existing

publishjs: ## dist to npm
cd js; npm publish || echo "can't publish - might already exist"

publish: dist publishpy publishjs ## dist to pypi and npm

docs: ## make documentation
make -C ./docs html
open ./docs/_build/html/index.html

clean: ## clean the repository
find . -name "__pycache__" | xargs rm -rf
find . -name "*.pyc" | xargs rm -rf
find . -name ".ipynb_checkpoints" | xargs rm -rf
rm -rf .coverage coverage *.xml build dist *.egg-info lib node_modules .pytest_cache *.egg-info .autoversion .mypy_cache
rm -rf jupyterlab_email/labextension
# make -C ./docs clean
git clean -fd

# Thanks to Francoise at marmelab.com for this
.DEFAULT_GOAL := help
help:
Expand All @@ -57,4 +71,4 @@ help:
print-%:
@echo '$*=$($*)'

.PHONY: clean install serverextension labextension test tests help docs dist js
.PHONY: testjs testpy tests test lintpy lintjs lint fixpy fixjs fix checks check build develop install labextension dist publishpy publishjs publish docs clean
Loading