-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #65 from cal-itp/better-dependencies
Start pulling in schedule refactor entities!
- Loading branch information
Showing
23 changed files
with
2,469 additions
and
308 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 |
---|---|---|
|
@@ -7,88 +7,96 @@ on: | |
- published | ||
|
||
jobs: | ||
checks: | ||
name: "Run Tests" | ||
lint: | ||
name: "lint" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.9' | ||
- name: Set up Pre-commit | ||
python-version: '3.10' | ||
- name: Run pre-commit | ||
uses: pre-commit/[email protected] | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install -r requirements.txt | ||
python -m pip install . | ||
|
||
test: | ||
name: "test" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.10' | ||
- name: Install poetry | ||
uses: abatilo/[email protected] | ||
- uses: google-github-actions/setup-gcloud@v0 | ||
with: | ||
service_account_key: ${{ secrets.GCP_SA_KEY }} | ||
export_default_credentials: true | ||
- name: Install dependencies | ||
run: poetry install | ||
- name: Run tests | ||
run: | | ||
pytest | ||
run: poetry run pytest | ||
|
||
release: | ||
pypi: | ||
name: "Release to PyPI" | ||
runs-on: ubuntu-latest | ||
needs: checks | ||
needs: | ||
- lint | ||
- test | ||
if: "github.event_name == 'release' && startsWith(github.event.release.tag_name, 'v')" | ||
steps: | ||
|
||
- uses: actions/checkout@v2 | ||
- name: "Set up Python" | ||
uses: actions/setup-python@v2 | ||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.9' | ||
- name: "Build package" | ||
run: | | ||
python setup.py build sdist | ||
- name: "TEST Upload to PyPI" | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
python-version: '3.10' | ||
- name: "Upload to TEST PyPI" | ||
uses: JRubics/[email protected] | ||
if: github.event.release.prerelease | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.PYPI_TEST_API_TOKEN }} | ||
repository_name: testpypi | ||
repository_url: https://test.pypi.org/legacy/ | ||
|
||
repository_username: __token__ | ||
repository_password: ${{ secrets.PYPI_TEST_API_TOKEN }} | ||
build_format: "sdist" | ||
- name: "Upload to PyPI" | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
uses: JRubics/poetry-publish@v1.11 | ||
if: "!github.event.release.prerelease" | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.PYPI_API_TOKEN }} | ||
repository_username: __token__ | ||
repository_password: ${{ secrets.PYPI_API_TOKEN }} | ||
build_format: "sdist" | ||
|
||
build_push: | ||
name: Package docker image | ||
runs-on: ubuntu-18.04 | ||
needs: ["checks", "release"] | ||
if: "success('checks') && !failure('release')" | ||
steps: | ||
#- uses: actions/checkout@v2 | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
# build release image ---- | ||
- name: "Release: Build and push" | ||
uses: docker/build-push-action@v2 | ||
if: ${{ github.event_name == 'release' && startsWith(github.event.release.tag_name, 'hub') }} | ||
with: | ||
push: true | ||
tags: ghcr.io/${{github.repository}}:${{ github.event.release.tag_name }} | ||
|
||
# build any image pushed on a branch starting with development ---- | ||
- name: "Development: Build and push" | ||
uses: docker/build-push-action@v2 | ||
if: ${{ github.event_name != 'release' && startsWith(github.ref_name, 'development') }} | ||
with: | ||
push: true | ||
tags: ghcr.io/${{github.repository}}:${{github.ref_name}} | ||
# This is disabled for now; I don't hate the image definition living here, but the CI/CD is overly complicated I think | ||
# build_push: | ||
# name: Package docker image | ||
# runs-on: ubuntu-18.04 | ||
# needs: | ||
# - lint | ||
# - test | ||
# - release | ||
# if: "success('lint') && success('test') && !failure('release')" | ||
# steps: | ||
# - name: Login to GitHub Container Registry | ||
# uses: docker/login-action@v1 | ||
# with: | ||
# registry: ghcr.io | ||
# username: ${{ github.actor }} | ||
# password: ${{ secrets.GITHUB_TOKEN }} | ||
# | ||
# # build release image ---- | ||
# - name: "Release: Build and push" | ||
# uses: docker/build-push-action@v2 | ||
# if: ${{ github.event_name == 'release' && startsWith(github.event.release.tag_name, 'hub') }} | ||
# with: | ||
# push: true | ||
# tags: ghcr.io/${{github.repository}}:${{ github.event.release.tag_name }} | ||
# | ||
# # build any image pushed on a branch starting with development ---- | ||
# - name: "Development: Build and push" | ||
# uses: docker/build-push-action@v2 | ||
# if: ${{ github.event_name != 'release' && startsWith(github.ref_name, 'development') }} | ||
# with: | ||
# push: true | ||
# tags: ghcr.io/${{github.repository}}:${{github.ref_name}} |
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,6 +1,4 @@ | ||
# flake8: noqa | ||
|
||
__version__ = "0.0.16" | ||
|
||
from .sql import get_table, write_table, query_sql, to_snakecase, get_engine | ||
from .storage import save_to_gcfs, read_gcfs | ||
from .sql import get_engine, get_table, query_sql, to_snakecase, write_table | ||
from .storage import read_gcfs, save_to_gcfs |
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
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
Oops, something went wrong.