Skip to content

Commit 7d88f03

Browse files
committed
build: initial commit
0 parents  commit 7d88f03

19 files changed

+2105
-0
lines changed

.github/ISSUE_TEMPLATE.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
* cmap version:
2+
* Python version:
3+
* Operating System:
4+
5+
### Description
6+
7+
Describe what you were trying to get done.
8+
Tell us what happened, what went wrong, and what you expected to happen.
9+
10+
### What I Did
11+
12+
```
13+
Paste the command(s) you ran and the output.
14+
If there was a crash, please include the traceback here.
15+
```

.github/TEST_FAIL_TEMPLATE.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
title: "{{ env.TITLE }}"
3+
labels: [bug]
4+
---
5+
The {{ workflow }} workflow failed on {{ date | date("YYYY-MM-DD HH:mm") }} UTC
6+
7+
The most recent failing test was on {{ env.PLATFORM }} py{{ env.PYTHON }}
8+
with commit: {{ sha }}
9+
10+
Full run: https://github.com/{{ repo }}/actions/runs/{{ env.RUN_ID }}
11+
12+
(This post will be updated if another test fails, as long as this issue remains open.)

.github/dependabot.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
2+
3+
version: 2
4+
updates:
5+
- package-ecosystem: "github-actions"
6+
directory: "/"
7+
schedule:
8+
interval: "weekly"
9+
commit-message:
10+
prefix: "ci(dependabot):"

.github/workflows/ci.yml

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
tags:
8+
- "v*"
9+
pull_request: {}
10+
workflow_dispatch:
11+
12+
jobs:
13+
check-manifest:
14+
name: Check Manifest
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v3
18+
- uses: actions/setup-python@v4
19+
with:
20+
python-version: "3.x"
21+
- run: pip install check-manifest && check-manifest
22+
23+
test:
24+
name: ${{ matrix.platform }} (${{ matrix.python-version }})
25+
runs-on: ${{ matrix.platform }}
26+
strategy:
27+
fail-fast: false
28+
matrix:
29+
python-version: ['3.8', '3.9', '3.10']
30+
platform: [ubuntu-latest, macos-latest, windows-latest]
31+
32+
steps:
33+
- name: Cancel Previous Runs
34+
uses: styfle/[email protected]
35+
with:
36+
access_token: ${{ github.token }}
37+
38+
- uses: actions/checkout@v3
39+
40+
- name: Set up Python ${{ matrix.python-version }}
41+
uses: actions/setup-python@v4
42+
with:
43+
python-version: ${{ matrix.python-version }}
44+
cache: 'pip'
45+
46+
- name: Install dependencies
47+
run: |
48+
python -m pip install -U pip
49+
python -m pip install tox tox-gh-actions
50+
51+
- name: Test with tox
52+
run: python -m tox
53+
env:
54+
PLATFORM: ${{ matrix.platform }}
55+
56+
- name: Coverage
57+
uses: codecov/codecov-action@v2
58+
59+
deploy:
60+
name: Deploy
61+
needs: test
62+
if: "success() && startsWith(github.ref, 'refs/tags/')"
63+
runs-on: ubuntu-latest
64+
65+
steps:
66+
- uses: actions/checkout@v3
67+
68+
- name: Set up Python
69+
uses: actions/setup-python@v4
70+
with:
71+
python-version: "3.x"
72+
73+
- name: install
74+
run: |
75+
git tag
76+
pip install -U pip
77+
pip install -U build twine
78+
python -m build
79+
twine check dist/*
80+
ls -lh dist
81+
82+
- name: Build and publish
83+
run: twine upload dist/*
84+
env:
85+
TWINE_USERNAME: __token__
86+
TWINE_PASSWORD: ${{ secrets.TWINE_API_KEY }}
87+
88+
- uses: softprops/action-gh-release@v1
89+
with:
90+
generate_release_notes: true
91+
92+
# [WIP]
93+
# https://python-semantic-release.readthedocs.io/en/latest/automatic-releases/github-actions.html
94+
# release:
95+
# runs-on: ubuntu-latest
96+
# concurrency: release
97+
98+
# steps:
99+
# - uses: actions/checkout@v3
100+
# with:
101+
# fetch-depth: 0
102+
103+
# - name: Python Semantic Release
104+
# uses: relekang/python-semantic-release@master
105+
# with:
106+
# github_token: ${{ secrets.GITHUB_TOKEN }}
107+
# repository_username: __token__
108+
# repository_password: ${{ secrets.TWINE_API_KEY }}

.github/workflows/cron.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: --pre Test
2+
# An "early warning" cron job that will install dependencies
3+
# with `pip install --pre` periodically to test for breakage
4+
# (and open an issue if a test fails)
5+
6+
on:
7+
schedule:
8+
- cron: '0 */12 * * *' # every 12 hours
9+
workflow_dispatch:
10+
11+
jobs:
12+
13+
test:
14+
name: ${{ matrix.platform }} (${{ matrix.python-version }})
15+
runs-on: ${{ matrix.platform }}
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
python-version: ['3.8', '3.9', '3.10']
20+
platform: [ubuntu-latest, macos-latest, windows-latest]
21+
22+
steps:
23+
- uses: actions/checkout@v3
24+
25+
- name: Set up Python ${{ matrix.python-version }}
26+
uses: actions/setup-python@v4
27+
with:
28+
python-version: ${{ matrix.python-version }}
29+
30+
- name: Install dependencies
31+
run: |
32+
python -m pip install -U pip
33+
python -m pip install tox tox-gh-actions
34+
35+
- name: Test with tox
36+
run: python -m tox -v --pre
37+
env:
38+
PLATFORM: ${{ matrix.platform }}
39+
40+
# If something goes wrong, we can open an issue in the repo
41+
- name: Report Failures
42+
if: ${{ failure() }}
43+
uses: JasonEtco/create-an-issue@v2
44+
env:
45+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
46+
PLATFORM: ${{ matrix.platform }}
47+
PYTHON: ${{ matrix.python }}
48+
RUN_ID: ${{ github.run_id }}
49+
TITLE: '[test-bot] pip install --pre is failing'
50+
with:
51+
filename: .github/TEST_FAIL_TEMPLATE.md
52+
update_existing: true

.github_changelog_generator

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
user=tlambert03
2+
project=cmap
3+
issues=false
4+
exclude-labels=duplicate,question,invalid,wontfix,hide
5+
add-sections={"tests":{"prefix":"**Tests & CI:**","labels":["tests"]}, "documentation":{"prefix":"**Documentation:**", "labels":["documentation"]}}
6+
exclude-tags-regex=.*rc

.gitignore

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
env/
12+
build/
13+
develop-eggs/
14+
dist/
15+
downloads/
16+
eggs/
17+
.eggs/
18+
lib/
19+
lib64/
20+
parts/
21+
sdist/
22+
var/
23+
wheels/
24+
*.egg-info/
25+
.installed.cfg
26+
*.egg
27+
28+
# PyInstaller
29+
# Usually these files are written by a python script from a template
30+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
31+
*.manifest
32+
*.spec
33+
34+
# Installer logs
35+
pip-log.txt
36+
pip-delete-this-directory.txt
37+
38+
# Unit test / coverage reports
39+
htmlcov/
40+
.tox/
41+
.coverage
42+
.coverage.*
43+
.cache
44+
nosetests.xml
45+
coverage.xml
46+
*.cover
47+
.hypothesis/
48+
.pytest_cache/
49+
50+
# Translations
51+
*.mo
52+
*.pot
53+
54+
# Django stuff:
55+
*.log
56+
local_settings.py
57+
58+
# Flask stuff:
59+
instance/
60+
.webassets-cache
61+
62+
# Scrapy stuff:
63+
.scrapy
64+
65+
# Sphinx documentation
66+
docs/_build/
67+
68+
# PyBuilder
69+
target/
70+
71+
# Jupyter Notebook
72+
.ipynb_checkpoints
73+
74+
# pyenv
75+
.python-version
76+
77+
# celery beat schedule file
78+
celerybeat-schedule
79+
80+
# SageMath parsed files
81+
*.sage.py
82+
83+
# dotenv
84+
.env
85+
86+
# virtualenv
87+
.venv
88+
venv/
89+
ENV/
90+
91+
# Spyder project settings
92+
.spyderproject
93+
.spyproject
94+
95+
# Rope project settings
96+
.ropeproject
97+
98+
# mkdocs documentation
99+
/site
100+
101+
# mypy
102+
.mypy_cache/
103+
104+
# IDE settings
105+
.vscode/
106+
107+
cmap/_version.py
108+
src/cmap/_version.py

.pre-commit-config.yaml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
ci:
2+
autoupdate_schedule: monthly
3+
autofix_commit_msg: "style(pre-commit.ci): auto fixes [...]"
4+
autoupdate_commit_msg: "ci(pre-commit.ci): autoupdate"
5+
6+
default_install_hook_types: [pre-commit, commit-msg]
7+
8+
repos:
9+
- repo: https://github.com/compilerla/conventional-pre-commit
10+
rev: v1.3.0
11+
hooks:
12+
- id: conventional-pre-commit
13+
stages: [commit-msg]
14+
15+
- repo: https://github.com/pre-commit/pre-commit-hooks
16+
rev: v4.3.0
17+
hooks:
18+
- id: check-docstring-first
19+
- id: end-of-file-fixer
20+
- id: trailing-whitespace
21+
22+
- repo: https://github.com/charliermarsh/ruff-pre-commit
23+
rev: v0.0.118
24+
hooks:
25+
- id: ruff
26+
args: [--fix]
27+
28+
- repo: https://github.com/psf/black
29+
rev: 22.10.0
30+
hooks:
31+
- id: black
32+
33+
- repo: https://github.com/abravalheri/validate-pyproject
34+
rev: v0.10.1
35+
hooks:
36+
- id: validate-pyproject
37+
38+
- repo: https://github.com/pre-commit/mirrors-mypy
39+
rev: v0.991
40+
hooks:
41+
- id: mypy
42+
files: "^src/"

LICENSE

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
BSD License
2+
3+
Copyright (c) 2022, Talley Lambert
4+
All rights reserved.
5+
6+
Redistribution and use in source and binary forms, with or without
7+
modification, are permitted provided that the following conditions are met:
8+
9+
1. Redistributions of source code must retain the above copyright notice, this
10+
list of conditions and the following disclaimer.
11+
12+
2. Redistributions in binary form must reproduce the above copyright notice,
13+
this list of conditions and the following disclaimer in the documentation
14+
and/or other materials provided with the distribution.
15+
16+
3. Neither the name of the copyright holder nor the names of its
17+
contributors may be used to endorse or promote products derived from
18+
this software without specific prior written permission.
19+
20+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

0 commit comments

Comments
 (0)