-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Packaging and distribution updates (#24)
* adjust package info to prep for ci/cd changes and docs * add yaml for rtd * fix conf.py * test rst change * adjust workflows for tests * adjust workflows for tests * adjust build test and release workflows * rm obsolete ttests * add concurrency grp to tests to avoid dupes * add concurrency grp to tests to avoid dupes * test concurrent rule * test concurrent rule * Delete tests/io/test_resstock.py * Delete tests/io/test_tmy3.py
- Loading branch information
Showing
39 changed files
with
201 additions
and
377 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: Deploy Main | ||
on: | ||
release: | ||
types: [published] | ||
|
||
env: | ||
PYTHON_VERSION: "3.12" | ||
|
||
jobs: | ||
deploy-pypi: | ||
runs-on: ubuntu-latest | ||
environment: deployment | ||
permissions: | ||
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing | ||
|
||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ env.PYTHON_VERSION }} | ||
|
||
- name: Install Twine and Build | ||
run: sudo pip install twine build | ||
|
||
- name: Create the distribution | ||
run: | | ||
git fetch --prune --unshallow --tags | ||
sudo python3 -m build | ||
- name: Publish package distributions to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: Test Build | ||
|
||
on: | ||
pull_request: | ||
branches: [main] | ||
jobs: | ||
build-pypi: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: [ "3.10", "3.11", "3.12" ] | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install Twine and Build | ||
run: sudo pip install twine build | ||
|
||
- name: Create the distribution | ||
run: | | ||
git fetch --prune --unshallow --tags | ||
sudo python3 -m build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,87 +1,57 @@ | ||
name: Tests | ||
on: [push] | ||
jobs: | ||
run-tests: | ||
runs-on: ubuntu-latest | ||
environment: test | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v3 | ||
|
||
# Necessary action when needing to use AWS credentials. | ||
- name: Configure AWS Credentials | ||
uses: aws-actions/configure-aws-credentials@v1 | ||
with: | ||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
aws-region: us-west-1 | ||
on: | ||
push: | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
- name: Install Python | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: '3.10' | ||
jobs: | ||
pre_job: | ||
runs-on: ubuntu-latest | ||
# Map a step output to a job output | ||
outputs: | ||
should_skip: ${{ steps.skip_check.outputs.should_skip }} | ||
steps: | ||
- id: skip_check | ||
uses: fkirc/skip-duplicate-actions@v5 | ||
with: | ||
concurrent_skipping: 'same_content_newer' | ||
paths_ignore: '["**/README.md", "**/docs/**"]' | ||
do_not_skip: '["pull_request"]' | ||
|
||
- name: Install Dependencies | ||
run: | | ||
sudo $pythonLocation/bin/python3 -m pip install -r requirements.txt | ||
sudo $pythonLocation/bin/python3 -m pip install awscli coverage | ||
sudo $pythonLocation/bin/python3 -m pip install setuptools --upgrade | ||
$pythonLocation/bin/python3 -m pip list | ||
run-tests: | ||
needs: pre_job | ||
if: needs.pre_job.outputs.should_skip != 'true' | ||
runs-on: ubuntu-latest | ||
environment: test | ||
concurrency: | ||
group: unit_tests | ||
cancel-in-progress: ${{ github.event_name == 'pull_request' }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: ["3.10", "3.11", "3.12"] | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 1 | ||
fetch-tags: true | ||
|
||
- name: Run Unit Tests | ||
run: sudo $pythonLocation/bin/python3 -m coverage run -m unittest | ||
- name: Install Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
# build-pypi: | ||
# runs-on: ubuntu-latest | ||
# needs: run-tests | ||
# steps: | ||
# - name: Checkout Repository | ||
# uses: actions/checkout@v3 | ||
# | ||
# - name: Install Python | ||
# uses: actions/setup-python@v3 | ||
# | ||
# - name: Install Twine | ||
# run: sudo pip install twine | ||
# | ||
# - name: Create the distribution | ||
# run: | | ||
# git fetch --prune --unshallow --tags | ||
# sudo python setup.py sdist bdist_wheel | ||
# build-conda: | ||
# runs-on: ubuntu-latest | ||
# needs: run-tests | ||
# sets default shell to remove need for source to run the conda shell | ||
# defaults: | ||
# run: | ||
# shell: bash -l {0} | ||
# environment: test-deployment | ||
# steps: | ||
# - name: Checkout Repository | ||
# uses: actions/checkout@v3 | ||
- name: Install Python Dependencies | ||
run: | | ||
curl -LsSf https://astral.sh/uv/install.sh | sh | ||
uv pip install --system --break-system-packages -r requirements.txt | ||
uv pip install --system --break-system-packages pytest pytest-cov pytest-github-report pytest-github-actions-annotate-failures | ||
# Much better than manual installation, original version Miniconda2-4.7.10-Linux-x86_64.sh is broken | ||
# - name: Install Miniconda | ||
# uses: conda-incubator/setup-miniconda@v2 | ||
# with: | ||
# auto-activate-base: true | ||
# activate-environment: "" | ||
# miniconda-version: "latest" | ||
# | ||
# - name: Install the Conda Dependencies | ||
# run: | | ||
# conda config --set always_yes yes --set auto_update_conda false | ||
# conda update conda | ||
# conda install conda-build | ||
# run install twice due to client-size to ensure all files downloaded | ||
# echo yes before login to prevent anaconda bug breaking automation | ||
# git tags MUST be fetched otherwise output will be blank | ||
# bash variables cannot be used in github actions, must use actions specific syntax and methods | ||
# - name: Build the Anaconda Package | ||
# id: condabuild | ||
# run: | | ||
# conda install anaconda-client | ||
# conda config --set anaconda_upload no | ||
# git fetch --prune --unshallow --tags | ||
# VERSION_FROM_GIT_TAG=$(git tag --list "v*[0-9]" --sort=version:refname | tail -1 | cut -c 2-)test conda build . -c anaconda -c pvlib -c slacgismo -c conda-forge --numpy 1.22.0 | ||
# echo '::set-output name=gitversion::$(git tag --list "v*[0-9]" --sort=version:refname | tail -1 | cut -c 2-)' | ||
- name: Run Unit Tests | ||
env: | ||
pytest_github_report: true | ||
pytest_verbosity: 2 | ||
run: pytest -v --cov=src --cov-report=xml --cov-report=term-missing --color=yes sg2t/tests/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# .readthedocs.yaml | ||
# Read the Docs configuration file | ||
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details | ||
|
||
# Required | ||
version: 2 | ||
|
||
# Set the OS, Python version and other tools you might need | ||
build: | ||
os: ubuntu-22.04 | ||
tools: | ||
python: "3.12" | ||
# You can also specify other tool versions: | ||
# nodejs: "19" | ||
# rust: "1.64" | ||
# golang: "1.19" | ||
|
||
# Build documentation in the "docs/" directory with Sphinx | ||
sphinx: | ||
configuration: docs/conf.py | ||
|
||
# Optionally build your docs in additional formats such as PDF and ePub | ||
# formats: | ||
# - epub | ||
|
||
# Optional but recommended, declare the Python requirements required | ||
# to build your documentation | ||
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html | ||
# python: | ||
# install: | ||
# - requirements: docs/requirements.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,57 @@ | ||
[build-system] | ||
requires = ["setuptools>=64.0", "setuptools-scm[toml]"] | ||
build-backend = "setuptools.build_meta" | ||
|
||
requires = ["setuptools", | ||
"setuptools_scm", | ||
"wheel"] | ||
[project] | ||
name = "slac-gismo-grid-tools" | ||
description = "SLAC GISMo Grid Tools is single core package for grid related data cleaning, manipulation and data science in Python." | ||
readme = "README.md" | ||
license.file = "LICENSE" | ||
authors = [ | ||
{ name = "Sara Miskovich", email = "[email protected]" }, | ||
{ name = "David Chassin", email = "[email protected]" }, | ||
{ name = "Mohamed Nijad "}, | ||
] | ||
keywords = ["grid", "load modeling", "electrid loadshapes"] | ||
requires-python = ">=3.6" | ||
|
||
#build-backend = 'setuptools.build_meta' | ||
dependencies = [ | ||
"numpy", | ||
"pandas", | ||
"jupyter", | ||
"matplotlib", | ||
"marimo" | ||
] | ||
|
||
classifiers = [ | ||
"Development Status :: 4 - Beta", | ||
"License :: OSI Approved :: BSD License", | ||
"Programming Language :: Python :: 3 :: Only", | ||
"Programming Language :: Python :: 3.6", | ||
"Programming Language :: Python :: 3.7", | ||
"Programming Language :: Python :: 3.8", | ||
"Programming Language :: Python :: 3.9", | ||
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Python :: 3.11", | ||
"Programming Language :: Python :: 3.12", | ||
"Intended Audience :: Science/Research", | ||
"Topic :: Scientific/Engineering", | ||
] | ||
dynamic = ["version"] | ||
[tool.setuptools_scm] | ||
|
||
[tool.setuptools.packages.find] | ||
include = ["sg2t*"] | ||
|
||
[project.optional-dependencies] | ||
docs = [ | ||
"sphinx", | ||
"sphinx-changelog>=1.2.0", | ||
"sphinx_design", | ||
] | ||
|
||
[project.urls] | ||
Homepage = "https://github.com/slacgismo/sg2t" | ||
Documentation = "https://sg2t.readthedocs.io/" | ||
"Bug Tracker" = "https://github.com/slacgismo/sg2t/issues" | ||
Discussions = "https://github.com/slacgismo/sg2t/discussions" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,4 @@ numpy | |
pandas | ||
jupyter | ||
matplotlib | ||
pyarrow | ||
boto3 | ||
scikit-learn | ||
marimo |
Oops, something went wrong.