Skip to content

Commit

Permalink
fix manifest, use pep517/518, update GHA
Browse files Browse the repository at this point in the history
  • Loading branch information
ocefpaf committed Nov 7, 2022
1 parent eb3cad8 commit f90cd25
Show file tree
Hide file tree
Showing 16 changed files with 72 additions and 2,480 deletions.
1 change: 0 additions & 1 deletion .gitattributes

This file was deleted.

24 changes: 11 additions & 13 deletions .github/workflows/publish.yml → .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
@@ -1,47 +1,45 @@
name: Publish to PyPI

on:
release:
types:
- published
on: ["push", "pull_request"]

defaults:
run:
shell: bash

jobs:
packages:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v1
uses: actions/setup-python@v4
with:
python-version: "3.x"

- name: Get tags
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
shell: bash

- name: Install build tools
run: |
python -m pip install --upgrade pip wheel setuptools setuptools_scm build jinja2
shell: bash
python -m pip install --upgrade pip build wheel twine check-manifest
- name: Build binary wheel
run: python -m build --sdist --wheel . --outdir dist

- name: CheckFiles
run: |
check-manifest --verbose
ls dist
shell: bash
- name: Test wheels
run: |
cd dist && python -m pip install branca*.whl
python -m twine check *
shell: bash
- name: Publish a Python distribution to PyPI
uses: pypa/gh-action-pypi-publish@master
if: ${{ github.event_name == 'release' }}
uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.PYPI_PASSWORD }}
33 changes: 10 additions & 23 deletions .github/workflows/test_code.yml
Original file line number Diff line number Diff line change
@@ -1,46 +1,33 @@
name: Code Tests

on:
pull_request:
push:
branches: [master, main]
on: ["push", "pull_request"]

jobs:
run:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.7", "3.8", "3.9", "3.10"]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
fail-fast: false

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Setup Conda
uses: s-weigand/setup-conda@v1
- name: Setup Micromamba
uses: mamba-org/provision-with-micromamba@v14
with:
update-conda: true
activate-conda: false
conda-channels: conda-forge
environment-file: false

- name: Python ${{ matrix.python-version }}
shell: bash -l {0}
run: |
conda create --name TEST python=${{ matrix.python-version }} pip --file requirements.txt --file requirements-dev.txt
source activate TEST
micromamba create --name TEST python=${{ matrix.python-version }} pip --file requirements.txt --file requirements-dev.txt --channel conda-forge
micromamba activate TEST
pip install -e . --no-deps --force-reinstall
- name: Debug Installation
shell: bash -l {0}
run: |
source activate TEST
which python
conda info --all
conda list
- name: Tests
shell: bash -l {0}
run: |
source activate TEST
pytest -vv -rxs tests -m "not headless"
micromamba activate TEST
python -m pytest -vv -rxs tests -m "not headless"
27 changes: 10 additions & 17 deletions .github/workflows/test_code_notebooks.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,28 @@
name: Notebook Tests

on:
pull_request:
push:
branches: [master]
on: ["push", "pull_request"]

jobs:
run:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Setup Conda
uses: s-weigand/setup-conda@v1
- name: Setup Micromamba
uses: mamba-org/provision-with-micromamba@v14
with:
update-conda: true
activate-conda: false
conda-channels: conda-forge
environment-file: false

- name: Python 3.9
- name: Python 3
shell: bash -l {0}
run: |
conda create --name TEST python=3.9 pip --file requirements.txt --file requirements-dev.txt
source activate TEST
micromamba create --name TEST python=3 pip --file requirements.txt --file requirements-dev.txt --channel conda-forge
micromamba activate TEST
pip install -e . --no-deps --force-reinstall
conda info --all
conda list
- name: Notebook tests
shell: bash -l {0}
run: |
source activate TEST
pytest --nbval-lax examples
micromamba activate TEST
python -m pytest --nbval-lax examples
25 changes: 9 additions & 16 deletions .github/workflows/test_selenium.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,28 @@
name: Headless Tests

on:
pull_request:
push:
branches: [master]
on: ["push", "pull_request"]

jobs:
run:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Setup Conda
uses: s-weigand/setup-conda@v1
- name: Setup Micromamba
uses: mamba-org/provision-with-micromamba@v14
with:
update-conda: true
activate-conda: false
conda-channels: conda-forge
environment-file: false

- name: Python 3.9
- name: Python 3
shell: bash -l {0}
run: |
conda create --name TEST python=3.9 pip --file requirements.txt --file requirements-dev.txt
source activate TEST
micromamba create --name TEST python=3 pip --file requirements.txt --file requirements-dev.txt --channel conda-forge
micromamba activate TEST
pip install -e . --no-deps --force-reinstall
conda info --all
conda list
- name: Tests
shell: bash -l {0}
run: |
source activate TEST
micromamba activate TEST
pytest -vv -rxs tests -m "headless"
37 changes: 0 additions & 37 deletions .github/workflows/test_tarball.yml

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,4 @@ geckodriver.log

# Pycharm
.idea/
branca/_version.py
22 changes: 15 additions & 7 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
include *.txt
include README.rst
include README.md
include branca/_cnames.json
include branca/_schemes.json
include branca/scheme_info.json
include branca/scheme_base_codes.json
include pyproject.toml

recursive-include branca *.py
recursive-include branca *.js
recursive-include branca/plugins *
recursive-include branca/templates *
include versioneer.py
include branca/_version.py
graft branca

prune docs
prune tests
prune examples
prune *.egg-info

exclude *.yml
exclude .pre-commit-config.yaml
exclude .gitignore
exclude .isort.cfg
exclude branca/_version.py
exclude .github
8 changes: 4 additions & 4 deletions branca/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import branca.colormap as colormap
import branca.element as element

from ._version import get_versions

__version__ = get_versions()['version']
del get_versions
try:
from ._version import __version__
except ImportError:
__version__ = "unknown"


__all__ = [
Expand Down
Loading

0 comments on commit f90cd25

Please sign in to comment.