Skip to content

Commit

Permalink
MAINT: update infrastructure (#222)
Browse files Browse the repository at this point in the history
* Stamen  to HOT

* update tests

* MAINT: update infrastructure

* relax tests
  • Loading branch information
martinfleis authored Oct 4, 2023
1 parent 6c2feee commit 603e3b5
Show file tree
Hide file tree
Showing 9 changed files with 165 additions and 359 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/release_to_pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Publish contextily to PyPI / GitHub

on:
push:
tags:
- "v*"

jobs:
build-n-publish:
name: Build and publish contextily to PyPI
runs-on: ubuntu-latest

steps:
- name: Checkout source
uses: actions/checkout@v3

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

- name: Build a binary wheel and a source tarball
run: |
python -m pip install --upgrade build
python -m build
- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}

- name: Create GitHub Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
draft: false
prerelease: false

- name: Get Asset name
run: |
export PKG=$(ls dist/ | grep tar)
set -- $PKG
echo "name=$1" >> $GITHUB_ENV
- name: Upload Release Asset (sdist) to GitHub
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: dist/${{ env.name }}
asset_name: ${{ env.name }}
asset_content_type: application/zip
23 changes: 6 additions & 17 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,35 +26,24 @@ jobs:
environment-file: ci/envs/310-conda-forge.yaml
- os: ubuntu
environment-file: ci/envs/39-conda-forge.yaml
defaults:
run:
shell: bash -l {0}

steps:
- name: checkout repo
uses: actions/checkout@v4

- name: setup micromamba
uses: mamba-org/provision-with-micromamba@main
uses: mamba-org/setup-micromamba@v1
with:
environment-file: ${{ matrix.environment-file }}
micromamba-version: "latest"

- name: Install contextily
shell: bash -l {0}
run: pip install .
if: matrix.os != 'windows'

- name: Install contextily
shell: powershell
run: pip install .
if: matrix.os == 'windows'

- name: run tests - bash
shell: bash -l {0}
run: pytest -v . --cov=contextily --cov-append --cov-report term-missing --cov-report xml
if: matrix.os != 'windows'

- name: run tests - powershell
shell: powershell
run: pytest -v . --cov=contextily --cov-append --cov-report term-missing --cov-report xml
if: matrix.os == 'windows'
- name: run tests
run: pytest -v . --cov=contextily --cov-append --cov-report term-missing --cov-report xml --color=yes

- uses: codecov/codecov-action@v3
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1 +1 @@
include LICENSE.txt README.md requirements.txt
include LICENSE.txt README.md
8 changes: 7 additions & 1 deletion contextily/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,10 @@
from .tile import *
from .plotting import add_basemap, add_attribution

__version__ = "1.3.0"
from importlib.metadata import PackageNotFoundError, version

try:
__version__ = version("contextily")
except PackageNotFoundError: # noqa
# package is not installed
pass
47 changes: 47 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
[build-system]
requires = ["setuptools>=61.0", "setuptools_scm[toml]>=6.2"]
build-backend = "setuptools.build_meta"

[tool.setuptools_scm]

[project]
name = "contextily"
dynamic = ["version"]
authors = [
{name = "Dani Arribas-Bel", email = "daniel.arribas.bel@gmail.com"},
]
maintainers = [
{name = "contextily contributors"},
]
license = {text = "3-Clause BSD"}
description = "Context geo-tiles in Python"
readme = "README.md"
classifiers = [
"License :: OSI Approved :: BSD License",
"Programming Language :: Python :: 3",
"Framework :: Matplotlib",
]
requires-python = ">=3.8"
dependencies = [
"geopy",
"matplotlib",
"mercantile",
"pillow",
"rasterio",
"requests",
"joblib",
"xyzservices"
]

[project.urls]
Home = "https://github.com/geopandas/contextily"
Repository = "https://github.com/geopandas/contextily"

[tool.setuptools.packages.find]
include = [
"contextily",
"contextily.*",
]

[tool.coverage.run]
omit = ["tests/*"]
8 changes: 0 additions & 8 deletions requirements.txt

This file was deleted.

Loading

0 comments on commit 603e3b5

Please sign in to comment.