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

switch to pyproject.toml #490

Merged
merged 3 commits into from
Apr 8, 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
9 changes: 9 additions & 0 deletions .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[bumpversion]
current_version = 3.1.2
commit = True
tag = True
tag_name = {new_version}

[bumpversion:file:rio_tiler/__init__.py]
search = __version__ = "{current_version}"
replace = __version__ = "{new_version}"
5 changes: 5 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[flake8]
ignore = E501,W503,E203
exclude = .git,__pycache__,docs/source/conf.py,old,build,dist
max-complexity = 14
max-line-length = 90
File renamed without changes.
32 changes: 16 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@ on:
tags:
- '*'
pull_request:
env:
LATEST_PY_VERSION: '3.9'

jobs:
tests:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7, 3.8, 3.9]
python-version: ['3.7', '3.8', '3.9']

steps:
- uses: actions/checkout@v2
Expand All @@ -29,16 +31,17 @@ jobs:
python -m pip install pre-commit codecov

- name: Install module
run: python -m pip install -e .["test"]
run: python -m pip install .["test"]

- name: Run pre-commit
if: ${{ matrix.python-version == env.LATEST_PY_VERSION }}
run: pre-commit run --all-files

- name: Run tests
run: python -m pytest --cov rio_tiler --cov-report xml --cov-report term-missing --benchmark-skip

- name: Upload Results
if: success()
if: ${{ matrix.python-version == env.LATEST_PY_VERSION }}
uses: codecov/codecov-action@v1
with:
file: ./coverage.xml
Expand All @@ -54,12 +57,12 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: "3.8"
python-version: ${{ env.LATEST_PY_VERSION }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install tox
python -m pip install -e .["test"]

- name: Cache benchmark data
uses: actions/cache@v2
Expand All @@ -68,9 +71,7 @@ jobs:
key: ${{ runner.os }}-${{ hashFiles('./tests/benchmarks/__init__.py') }}

- name: Run Benchmark
env:
TOXENV: benchmark
run: tox
run: python -m pytest --benchmark-only --benchmark-autosave --benchmark-columns 'min, max, mean, median' --benchmark-sort 'min'

publish:
needs: [tests]
Expand All @@ -81,12 +82,13 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: "3.x"
python-version: ${{ env.LATEST_PY_VERSION }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install tox
python -m pip install flit
python -m pip install .

- name: Set tag version
id: tag
Expand All @@ -95,13 +97,11 @@ jobs:

- name: Set module version
id: module
# https://stackoverflow.com/questions/58177786/get-the-current-pushed-tag-in-github-actions
run: echo ::set-output name=version::$(python setup.py --version)
run: echo ::set-output name=version::$(python -c 'from importlib.metadata import version; print(version("rio_tiler"))')

- name: Build and publish
if: steps.tag.outputs.tag == steps.module.outputs.version
env:
TOXENV: release
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: tox
FLIT_USERNAME: ${{ secrets.PYPI_USERNAME }}
FLIT_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: flit publish
4 changes: 2 additions & 2 deletions .github/workflows/deploy_mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
- name: update API docs
run: |
pdocs as_markdown \
--output_dir docs/api/ \
--output_dir docs/src/api/ \
--exclude_source \
--overwrite \
rio_tiler.colormap \
Expand All @@ -56,4 +56,4 @@ jobs:
rio_tiler.utils

- name: Deploy docs
run: mkdocs gh-deploy --force
run: mkdocs gh-deploy -f docs/mkdocs.yml --force
6 changes: 4 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/psf/black
rev: 21.10b0
rev: 22.3.0
hooks:
- id: black
language_version: python
Expand All @@ -18,10 +18,12 @@ repos:
language_version: python

- repo: https://github.com/PyCQA/pydocstyle
rev: 5.1.1
rev: 6.1.1
hooks:
- id: pydocstyle
language_version: python
additional_dependencies:
- toml

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.812
Expand Down
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Unreleased

* Switch to `pyproject.toml` and `flit` for packaging

# 3.1.2 (2022-03-25)

* avoid calculating statistics for non-finite values (https://github.com/cogeotiff/rio-tiler/pull/489)
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ To manually deploy docs (note you should never need to do this because Github
Actions deploys automatically for new commits.):

```bash
$ mkdocs gh-deploy
$ mkdocs gh-deploy -f docs/mkdocs.yml
```

```bash
pdocs as_markdown \
--output_dir docs/api/ \
--output_dir docs/src/api/ \
--exclude_source \
--overwrite \
rio_tiler.colormap \
Expand Down
2 changes: 0 additions & 2 deletions MANIFEST.in

This file was deleted.

1 change: 0 additions & 1 deletion docs/contributing.md

This file was deleted.

1 change: 0 additions & 1 deletion docs/index.md

This file was deleted.

4 changes: 2 additions & 2 deletions mkdocs.yml → docs/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
site_name: 'rio-tiler'
site_description: 'User friendly Rasterio plugin to read raster datasets.'

docs_dir: 'docs'
docs_dir: 'src'
site_dir: 'build'

# Repository
Expand Down Expand Up @@ -85,7 +85,7 @@ theme:
font:
text: 'Nunito Sans'
code: 'Fira Code'
custom_dir: 'docs/overrides'
custom_dir: 'src/overrides'

# These extensions are chosen to be a superset of Pandoc's Markdown.
# This way, I can write in Pandoc's Markdown and have it be supported here.
Expand Down
1 change: 0 additions & 1 deletion docs/release-notes.md

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading