Skip to content

Commit 6589f5f

Browse files
authored
Merge pull request #119 from ocefpaf/update_gha
update GHA
2 parents 9f55176 + f90cd25 commit 6589f5f

16 files changed

+72
-2480
lines changed

.gitattributes

Lines changed: 0 additions & 1 deletion
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,45 @@
11
name: Publish to PyPI
22

3-
on:
4-
release:
5-
types:
6-
- published
3+
on: ["push", "pull_request"]
4+
5+
defaults:
6+
run:
7+
shell: bash
78

89
jobs:
910
packages:
1011
runs-on: ubuntu-latest
1112
steps:
12-
- uses: actions/checkout@v2
13+
- uses: actions/checkout@v3
1314

1415
- name: Set up Python
15-
uses: actions/setup-python@v1
16+
uses: actions/setup-python@v4
1617
with:
1718
python-version: "3.x"
1819

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

2323
- name: Install build tools
2424
run: |
25-
python -m pip install --upgrade pip wheel setuptools setuptools_scm build jinja2
26-
27-
shell: bash
25+
python -m pip install --upgrade pip build wheel twine check-manifest
2826
2927
- name: Build binary wheel
3028
run: python -m build --sdist --wheel . --outdir dist
3129

3230
- name: CheckFiles
3331
run: |
32+
check-manifest --verbose
3433
ls dist
35-
shell: bash
3634
3735
- name: Test wheels
3836
run: |
3937
cd dist && python -m pip install branca*.whl
4038
python -m twine check *
41-
shell: bash
4239
4340
- name: Publish a Python distribution to PyPI
44-
uses: pypa/gh-action-pypi-publish@master
41+
if: ${{ github.event_name == 'release' }}
42+
uses: pypa/gh-action-pypi-publish@v1.5.1
4543
with:
4644
user: __token__
4745
password: ${{ secrets.PYPI_PASSWORD }}

.github/workflows/test_code.yml

Lines changed: 10 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,33 @@
11
name: Code Tests
22

3-
on:
4-
pull_request:
5-
push:
6-
branches: [master, main]
3+
on: ["push", "pull_request"]
74

85
jobs:
96
run:
107
runs-on: ${{ matrix.os }}
118
strategy:
129
matrix:
1310
os: [ubuntu-latest, windows-latest, macos-latest]
14-
python-version: ["3.7", "3.8", "3.9", "3.10"]
11+
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
1512
fail-fast: false
1613

1714
steps:
18-
- uses: actions/checkout@v2
15+
- uses: actions/checkout@v3
1916

20-
- name: Setup Conda
21-
uses: s-weigand/setup-conda@v1
17+
- name: Setup Micromamba
18+
uses: mamba-org/provision-with-micromamba@v14
2219
with:
23-
update-conda: true
24-
activate-conda: false
25-
conda-channels: conda-forge
20+
environment-file: false
2621

2722
- name: Python ${{ matrix.python-version }}
2823
shell: bash -l {0}
2924
run: |
30-
conda create --name TEST python=${{ matrix.python-version }} pip --file requirements.txt --file requirements-dev.txt
31-
source activate TEST
25+
micromamba create --name TEST python=${{ matrix.python-version }} pip --file requirements.txt --file requirements-dev.txt --channel conda-forge
26+
micromamba activate TEST
3227
pip install -e . --no-deps --force-reinstall
3328
34-
- name: Debug Installation
35-
shell: bash -l {0}
36-
run: |
37-
source activate TEST
38-
which python
39-
conda info --all
40-
conda list
41-
4229
- name: Tests
4330
shell: bash -l {0}
4431
run: |
45-
source activate TEST
46-
pytest -vv -rxs tests -m "not headless"
32+
micromamba activate TEST
33+
python -m pytest -vv -rxs tests -m "not headless"
Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,28 @@
11
name: Notebook Tests
22

3-
on:
4-
pull_request:
5-
push:
6-
branches: [master]
3+
on: ["push", "pull_request"]
74

85
jobs:
96
run:
107
runs-on: ubuntu-latest
118

129
steps:
13-
- uses: actions/checkout@v2
10+
- uses: actions/checkout@v3
1411

15-
- name: Setup Conda
16-
uses: s-weigand/setup-conda@v1
12+
- name: Setup Micromamba
13+
uses: mamba-org/provision-with-micromamba@v14
1714
with:
18-
update-conda: true
19-
activate-conda: false
20-
conda-channels: conda-forge
15+
environment-file: false
2116

22-
- name: Python 3.9
17+
- name: Python 3
2318
shell: bash -l {0}
2419
run: |
25-
conda create --name TEST python=3.9 pip --file requirements.txt --file requirements-dev.txt
26-
source activate TEST
20+
micromamba create --name TEST python=3 pip --file requirements.txt --file requirements-dev.txt --channel conda-forge
21+
micromamba activate TEST
2722
pip install -e . --no-deps --force-reinstall
28-
conda info --all
29-
conda list
3023
3124
- name: Notebook tests
3225
shell: bash -l {0}
3326
run: |
34-
source activate TEST
35-
pytest --nbval-lax examples
27+
micromamba activate TEST
28+
python -m pytest --nbval-lax examples
Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,28 @@
11
name: Headless Tests
22

3-
on:
4-
pull_request:
5-
push:
6-
branches: [master]
3+
on: ["push", "pull_request"]
74

85
jobs:
96
run:
107
runs-on: ubuntu-latest
118

129
steps:
13-
- uses: actions/checkout@v2
10+
- uses: actions/checkout@v3
1411

15-
- name: Setup Conda
16-
uses: s-weigand/setup-conda@v1
12+
- name: Setup Micromamba
13+
uses: mamba-org/provision-with-micromamba@v14
1714
with:
18-
update-conda: true
19-
activate-conda: false
20-
conda-channels: conda-forge
15+
environment-file: false
2116

22-
- name: Python 3.9
17+
- name: Python 3
2318
shell: bash -l {0}
2419
run: |
25-
conda create --name TEST python=3.9 pip --file requirements.txt --file requirements-dev.txt
26-
source activate TEST
20+
micromamba create --name TEST python=3 pip --file requirements.txt --file requirements-dev.txt --channel conda-forge
21+
micromamba activate TEST
2722
pip install -e . --no-deps --force-reinstall
28-
conda info --all
29-
conda list
3023
3124
- name: Tests
3225
shell: bash -l {0}
3326
run: |
34-
source activate TEST
27+
micromamba activate TEST
3528
pytest -vv -rxs tests -m "headless"

.github/workflows/test_tarball.yml

Lines changed: 0 additions & 37 deletions
This file was deleted.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,4 @@ geckodriver.log
5959

6060
# Pycharm
6161
.idea/
62+
branca/_version.py

MANIFEST.in

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,21 @@
11
include *.txt
2-
include README.rst
2+
include README.md
33
include branca/_cnames.json
44
include branca/_schemes.json
55
include branca/scheme_info.json
66
include branca/scheme_base_codes.json
7+
include pyproject.toml
78

8-
recursive-include branca *.py
9-
recursive-include branca *.js
10-
recursive-include branca/plugins *
11-
recursive-include branca/templates *
12-
include versioneer.py
13-
include branca/_version.py
9+
graft branca
10+
11+
prune docs
12+
prune tests
13+
prune examples
14+
prune *.egg-info
15+
16+
exclude *.yml
17+
exclude .pre-commit-config.yaml
18+
exclude .gitignore
19+
exclude .isort.cfg
20+
exclude branca/_version.py
21+
exclude .github

branca/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import branca.colormap as colormap
22
import branca.element as element
33

4-
from ._version import get_versions
5-
6-
__version__ = get_versions()['version']
7-
del get_versions
4+
try:
5+
from ._version import __version__
6+
except ImportError:
7+
__version__ = "unknown"
88

99

1010
__all__ = [

0 commit comments

Comments
 (0)