Skip to content

Commit

Permalink
Clean repo for test.pypi release
Browse files Browse the repository at this point in the history
  • Loading branch information
sarahshi committed Nov 14, 2023
1 parent 5ae6e36 commit 6b7f9f0
Show file tree
Hide file tree
Showing 184 changed files with 1,058,360 additions and 419,422 deletions.
81 changes: 81 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: Test and publish to PyPI

on:
push:
branches: [ main ]
tags: [ 'v*.*.*' ]
pull_request:
branches: [ main ]
release:
types: [ created ]


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

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
- name: Install my package
run: |
python -m pip install .
- name: Install test dependencies
run: |
pip install flake8 pytest coverage
- name: Test with pytest
run: |
coverage run -m pytest
- name: Clean up coverage data
run: |
# This is a workaround for the fact that the `[coverage:paths]` section
# of `setup.cfg` is not actually applies until we run `combine`; so we
# rename the report such that we can then "combine" it.
mv .coverage .coverage.hack
coverage combine
coverage report
- uses: codecov/codecov-action@v1

deploy:
needs: test
runs-on: ubuntu-latest
name: deploy
steps:
- uses: actions/checkout@v2
- name: Set up Python '3.9'
uses: actions/setup-python@v2
with:
python-version: '3.9'
- name: "Install"
run: |
python -m pip install --upgrade pip;
python -m pip install build
pip install setuptools wheel twine
python setup.py sdist bdist_wheel
- uses: actions/upload-artifact@v2
with:
name: dist
path: dist

- name: Publish to PyPI (on tag)
if: startsWith(github.ref, 'refs/tags/v')
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.pypi_token }}
21 changes: 10 additions & 11 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
.DS_Store
__pycache__
GEOROC_minerals/
backup/
working/
Validation_Data/LEPR_Penny/
Validation_Data/GEOROC_validationdata.csv
MIN_ML_Cluster/scs76-31450.log
MIN_ML_Cluster/scs76-31497.log
MIN_ML_Cluster/nn_parametermatrix/nkfcv_test_saveall_test_reports.pkl
MIN_ML_Cluster/nn_parametermatrix/nkfcv_test_saveall_train_reports.pkl
MIN_ML_Cluster/nkfcv_test_saveall_results.npz
georoc_err.csv
*.ipynb
*.icloud
/GEOROC_minerals/
/backup/
/working/
/Validation_Data/LEPR_Penny/
/Validation_Data/GEOROC_validationdata.csv
/Training_Data/Mineral/
/MIN_ML_Cluster/t
/parametermatrix_autoencoder/features/
18 changes: 18 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Read the Docs configuration file for Sphinx projects
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

version: 2

# Build documentation in the "docs/" directory with Sphinx
build:
os: "ubuntu-22.04"
tools:
python: "mambaforge-22.9"

sphinx:
configuration: docs/conf.py
# Fail on all warnings to avoid broken references
fail_on_warning: true

conda:
environment: docs/rtd_environment.yml
Loading

0 comments on commit 6b7f9f0

Please sign in to comment.