Skip to content

Commit

Permalink
Merge pull request #169 from os-climate/build-and-linting-updates
Browse files Browse the repository at this point in the history
Chore: Migrate to PDM build system; many linting updates
  • Loading branch information
ModeSevenIndustrialSolutions authored Nov 23, 2023
2 parents 43a7a63 + 2a0433e commit 797bd82
Show file tree
Hide file tree
Showing 132 changed files with 8,598 additions and 5,332 deletions.
8 changes: 5 additions & 3 deletions .aicoe-ci.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
---
# Setup and configuring aicoe-ci with configuration file `.aicoe-ci.yaml`
# Example `.aicoe-ci.yaml` with a full list of config options is available here: https://github.com/AICoE/aicoe-ci/blob/master/docs/.aicoe-ci.yaml
# Example `.aicoe-ci.yaml` with a full list of config options is available
# here: https://github.com/AICoE/aicoe-ci/blob/master/docs/.aicoe-ci.yaml
check:
# Uncomment following line to build a public image of this repo
# - thoth-build
# Uncomment following line to build a public image of this repo
# - thoth-build
# Uncomment following lines to build a public image of this repo
# build:
# build-stratergy: Source
Expand Down
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:

1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
Expand Down
5 changes: 2 additions & 3 deletions .github/PULL_REQUEST_TEMPLATE/POLISH_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ about: Finalize notebooks prior to publishing or promoting


## The following checklist items have been completed for each notebook in this PR:
## The following checklist items have been completed for each notebook in this PR

- [ ] Proofread by other team member for grammar and spelling
- [ ] Proofread by other team member for coherence and reproducibility (does the analysis make sense as you read through the code and markdown from top to bottom?)
Expand All @@ -25,7 +25,6 @@ about: Finalize notebooks prior to publishing or promoting
- [ ] Cell execution counts are in order (a working "run all" was performed just before PR)
- [ ] All pre-commit checks pass



## Additional context

<!-- If there is some reason that one of the above steps could not be completed, please describe what it is and why. -->
28 changes: 15 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,29 @@
---
name: CI

# yamllint disable-line rule:truthy
on:
push:
branches: [ main ]
branches: [main]
pull_request:
branches: [ main ]
branches: [main]

jobs:
ci:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v2

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: "3.8"
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.9'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox
- name: Run auto-tests
run: tox
- name: Run auto-tests
run: tox
69 changes: 31 additions & 38 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
@@ -1,47 +1,40 @@
# This workflow will upload a Python Package using Twine when a release is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

---
name: Publish Packages to PyPI and TestPyPI

# yamllint disable-line rule:truthy
on: push

jobs:
deploy:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

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

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Output Run ID
run: |
value=`cat VERSION`
echo "$value-dev${{ github.run_id }}" > VERSION
echo ${{ github.run_id }}
- name: Output Run Number
run: echo ${{ github.run_number }}

- name: Build package
run: python -m build

- name: Publish package to Test PyPI
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
- uses: actions/checkout@v2

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

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Output Run ID
run: |
value=$(cat VERSION)
echo "$value-dev${{ github.run_id }}" > VERSION
echo ${{ github.run_id }}
- name: Output Run Number
run: echo ${{ github.run_number }}

- name: Build package
run: python -m build

- name: Publish package to Test PyPI
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
46 changes: 24 additions & 22 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,36 @@
# This workflow will upload a Python package using Twine when a tagged commit is merged.
---
# This workflow will upload a Python package using
# Twine when a tagged commit is merged.

name: Publish on PyPI

# yamllint disable-line rule:truthy
on:
push:
tags:
- v*
- v*

jobs:
deploy:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

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

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
- uses: actions/checkout@v2

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

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
55 changes: 53 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,19 +1,28 @@
# Credentials / Secrets
credentials.env
config.toml

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

.idea/*
*.iml

# C extensions
*.so

# Distribution / packaging
.Python
env/
.pdm-python
.pdm-build
.pdm.toml
.tox
build/
develop-eggs/
dist/
dist/**
!app/static/frontend/dist/
downloads/
eggs/
.eggs/
Expand All @@ -22,9 +31,14 @@ lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST


# PyInstaller
# Usually these files are written by a python script from a template
Expand All @@ -39,19 +53,26 @@ pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Sphinx documentation
docs/_build/
Expand Down Expand Up @@ -95,3 +116,33 @@ target/
.venv/*
src/test/data/coords.json
credentials.env

# pyenv
.python-version

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

%USERPROFILE%/*

# vscode
.vscode

# Misc
.noseids
test/.DS_Store
.DS_Store
7 changes: 7 additions & 0 deletions .markdownlint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"MD013": {
"line_length": 300,
"code_block_line_length": 300,
"tables": false
}
}
Loading

0 comments on commit 797bd82

Please sign in to comment.