Skip to content

Commit 603e3b5

Browse files
authored
MAINT: update infrastructure (#222)
* Stamen to HOT * update tests * MAINT: update infrastructure * relax tests
1 parent 6c2feee commit 603e3b5

File tree

9 files changed

+165
-359
lines changed

9 files changed

+165
-359
lines changed
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Publish contextily to PyPI / GitHub
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
jobs:
9+
build-n-publish:
10+
name: Build and publish contextily to PyPI
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout source
15+
uses: actions/checkout@v3
16+
17+
- name: Set up Python
18+
uses: actions/setup-python@v2
19+
with:
20+
python-version: "3.x"
21+
22+
- name: Build a binary wheel and a source tarball
23+
run: |
24+
python -m pip install --upgrade build
25+
python -m build
26+
27+
- name: Publish distribution to PyPI
28+
uses: pypa/gh-action-pypi-publish@release/v1
29+
with:
30+
user: __token__
31+
password: ${{ secrets.PYPI_API_TOKEN }}
32+
33+
- name: Create GitHub Release
34+
id: create_release
35+
uses: actions/create-release@v1
36+
env:
37+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
38+
with:
39+
tag_name: ${{ github.ref }}
40+
release_name: ${{ github.ref }}
41+
draft: false
42+
prerelease: false
43+
44+
- name: Get Asset name
45+
run: |
46+
export PKG=$(ls dist/ | grep tar)
47+
set -- $PKG
48+
echo "name=$1" >> $GITHUB_ENV
49+
50+
- name: Upload Release Asset (sdist) to GitHub
51+
id: upload-release-asset
52+
uses: actions/upload-release-asset@v1
53+
env:
54+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
55+
with:
56+
upload_url: ${{ steps.create_release.outputs.upload_url }}
57+
asset_path: dist/${{ env.name }}
58+
asset_name: ${{ env.name }}
59+
asset_content_type: application/zip

.github/workflows/tests.yaml

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -26,35 +26,24 @@ jobs:
2626
environment-file: ci/envs/310-conda-forge.yaml
2727
- os: ubuntu
2828
environment-file: ci/envs/39-conda-forge.yaml
29+
defaults:
30+
run:
31+
shell: bash -l {0}
2932

3033
steps:
3134
- name: checkout repo
3235
uses: actions/checkout@v4
3336

3437
- name: setup micromamba
35-
uses: mamba-org/provision-with-micromamba@main
38+
uses: mamba-org/setup-micromamba@v1
3639
with:
3740
environment-file: ${{ matrix.environment-file }}
3841
micromamba-version: "latest"
3942

4043
- name: Install contextily
41-
shell: bash -l {0}
4244
run: pip install .
43-
if: matrix.os != 'windows'
44-
45-
- name: Install contextily
46-
shell: powershell
47-
run: pip install .
48-
if: matrix.os == 'windows'
49-
50-
- name: run tests - bash
51-
shell: bash -l {0}
52-
run: pytest -v . --cov=contextily --cov-append --cov-report term-missing --cov-report xml
53-
if: matrix.os != 'windows'
5445

55-
- name: run tests - powershell
56-
shell: powershell
57-
run: pytest -v . --cov=contextily --cov-append --cov-report term-missing --cov-report xml
58-
if: matrix.os == 'windows'
46+
- name: run tests
47+
run: pytest -v . --cov=contextily --cov-append --cov-report term-missing --cov-report xml --color=yes
5948

6049
- uses: codecov/codecov-action@v3

MANIFEST.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
include LICENSE.txt README.md requirements.txt
1+
include LICENSE.txt README.md

contextily/__init__.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,10 @@
77
from .tile import *
88
from .plotting import add_basemap, add_attribution
99

10-
__version__ = "1.3.0"
10+
from importlib.metadata import PackageNotFoundError, version
11+
12+
try:
13+
__version__ = version("contextily")
14+
except PackageNotFoundError: # noqa
15+
# package is not installed
16+
pass

pyproject.toml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
[build-system]
2+
requires = ["setuptools>=61.0", "setuptools_scm[toml]>=6.2"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[tool.setuptools_scm]
6+
7+
[project]
8+
name = "contextily"
9+
dynamic = ["version"]
10+
authors = [
11+
{name = "Dani Arribas-Bel", email = "[email protected]"},
12+
]
13+
maintainers = [
14+
{name = "contextily contributors"},
15+
]
16+
license = {text = "3-Clause BSD"}
17+
description = "Context geo-tiles in Python"
18+
readme = "README.md"
19+
classifiers = [
20+
"License :: OSI Approved :: BSD License",
21+
"Programming Language :: Python :: 3",
22+
"Framework :: Matplotlib",
23+
]
24+
requires-python = ">=3.8"
25+
dependencies = [
26+
"geopy",
27+
"matplotlib",
28+
"mercantile",
29+
"pillow",
30+
"rasterio",
31+
"requests",
32+
"joblib",
33+
"xyzservices"
34+
]
35+
36+
[project.urls]
37+
Home = "https://github.com/geopandas/contextily"
38+
Repository = "https://github.com/geopandas/contextily"
39+
40+
[tool.setuptools.packages.find]
41+
include = [
42+
"contextily",
43+
"contextily.*",
44+
]
45+
46+
[tool.coverage.run]
47+
omit = ["tests/*"]

requirements.txt

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

0 commit comments

Comments
 (0)