Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentsarago committed Jul 20, 2022
1 parent c3a3aa3 commit 5930a53
Show file tree
Hide file tree
Showing 40 changed files with 646 additions and 0 deletions.
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 = 0.1.0
commit = True
tag = True
tag_name = {new_version}

[bumpversion:file:rio_fake/__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
8 changes: 8 additions & 0 deletions .github/codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
comment: off

coverage:
status:
project:
default:
target: auto
threshold: 5
82 changes: 82 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: CI

# On every pull request, but only on push to master
on:
push:
branches:
- master
tags:
- '*'
pull_request:

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

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install codecov pre-commit
- name: Install rio-faux
run: python -m pip install .["test"]

- name: Run test
run: python -m pytest --cov rio_faux --cov-report xml --cov-report term-missing

# Run pre-commit
- name: run pre-commit
run: pre-commit run --all-files

- name: Upload Results
if: success()
uses: codecov/codecov-action@v1
with:
file: ./coverage.xml
flags: unittests
name: ${{ matrix.python-version }}
fail_ci_if_error: false

publish:
needs: [tests]
runs-on: ubuntu-latest
if: startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release'
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: 3.8

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flit
python -m pip install .
- name: Set tag version
id: tag
# https://stackoverflow.com/questions/58177786/get-the-current-pushed-tag-in-github-actions
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/}

- 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 -c 'from importlib.metadata import version; print(version("rio_faux"))')

- name: Build and publish
if: steps.tag.outputs.tag == steps.module.outputs.version
env:
FLIT_USERNAME: ${{ secrets.PYPI_USERNAME }}
FLIT_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: flit publish
33 changes: 33 additions & 0 deletions .github/workflows/deploy_mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Publish docs via GitHub Pages

on:
push:
branches:
- master
paths:
# Only rebuild website when docs have changed
- 'README.md'
- 'CHANGES.md'
- 'CONTRIBUTING.md'
- 'docs/**'

jobs:
build:
name: Deploy docs
runs-on: ubuntu-latest
steps:
- name: Checkout master
uses: actions/checkout@v2

- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -e .["docs"]
- name: Deploy docs
run: mkdocs gh-deploy -f docs/mkdocs.yml --force
103 changes: 103 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# SageMath parsed files
*.sage.py

# dotenv
.env

# virtualenv
.venv
venv/
ENV/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/

.pytest_cache
32 changes: 32 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
repos:
- repo: https://github.com/psf/black
rev: 22.3.0
hooks:
- id: black
language_version: python

- repo: https://github.com/PyCQA/isort
rev: 5.4.2
hooks:
- id: isort
language_version: python

- repo: https://github.com/PyCQA/flake8
rev: 3.8.3
hooks:
- id: flake8
language_version: python

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

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.812
hooks:
- id: mypy
language_version: python
5 changes: 5 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Release Notes

## 0.1.0

* Initial release.
45 changes: 45 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Contributing

Issues and pull requests are more than welcome.

**dev install**

```bash
$ git clone https://github.com/cogeotiff/rio-faux.git
$ cd rio-faux
$ pip install -e .["test","dev"]
```
You can then run the tests with the following command:

```sh
python -m pytest --cov rio_faux --cov-report term-missing
```

## pre-commit

This repo is set to use `pre-commit` to run *isort*, *flake8*, *pydocstring*, *black* ("uncompromising Python code formatter") and mypy when committing new code.

```bash
$ pre-commit install
```

## Docs

```bash
$ git clone https://github.com/cogeotiff/rio-faux.git
$ cd rio-faux
$ pip install -e .["docs"]
```

Hot-reloading docs:

```bash
$ mkdocs serve
```

To manually deploy docs (note you should never need to do this because Github
Actions deploys automatically for new commits.):

```bash
$ mkdocs gh-deploy
```
58 changes: 58 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# rio-faux

<p align="center">
<em>Create empty image from a model.</em>
</p>

<p align="center">
<a href="https://github.com/cogeotiff/rio-faux/actions?query=workflow%3ACI" target="_blank">
<img src="https://github.com/cogeotiff/rio-faux/workflows/CI/badge.svg" alt="Test">
</a>
<a href="https://codecov.io/gh/cogeotiff/rio-faux" target="_blank">
<img src="https://codecov.io/gh/cogeotiff/rio-faux/branch/master/graph/badge.svg" alt="Coverage">
</a>
<a href="https://pypi.org/project/rio-faux" target="_blank">
<img src="https://img.shields.io/pypi/v/rio-faux?color=%2334D058&label=pypi%20package" alt="Package version">
</a>
<a href="https://pypistats.org/packages/rio-faux" target="_blank">
<img src="https://img.shields.io/pypi/dm/rio-faux.svg" alt="Downloads">
</a>
<a href="https://github.com/cogeotiff/rio-faux/blob/master/LICENSE" target="_blank">
<img src="https://img.shields.io/github/license/cogeotiff/rio-faux.svg" alt="Downloads">
</a>
</p>

---

**Documentation**: <a href="https://cogeotiff.github.io/rio-faux/" target="_blank">https://cogeotiff.github.io/rio-faux/</a>

**Source Code**: <a href="https://github.com/cogeotiff/rio-faux" target="_blank">https://github.com/cogeotiff/rio-faux</a>

---

## Install

```bash
$ pip install -U pip
$ pip install rio-faux
```

Or install from source:

```bash
$ pip install -U pip
$ pip install git+https://github.com/cogeotiff/rio-faux.git
```

## Contribution & Development

See [CONTRIBUTING.md](https://github.com/cogeotiff/rio-faux/blob/master/CONTRIBUTING.md)

## Changes

See [CHANGES.md](https://github.com/cogeotiff/rio-faux/blob/master/CHANGES.md).

## License

See [LICENSE](https://github.com/cogeotiff/rio-faux/blob/master/LICENSE)

1 change: 1 addition & 0 deletions docs/docs/contributing.md
5 changes: 5 additions & 0 deletions docs/docs/css/extra.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
:root {
--md-primary-fg-color: #231b4e;;
--md-primary-fg-color--light: #8782a3;
--md-primary-fg-color--dark: #3b3750;
}
Loading

0 comments on commit 5930a53

Please sign in to comment.