Skip to content

Commit

Permalink
refactor: move packaging information to pyproject.toml (#549)
Browse files Browse the repository at this point in the history
Co-authored-by: epwalsh <[email protected]>
  • Loading branch information
SauravMaheshkar and epwalsh authored Apr 17, 2023
1 parent e86ad65 commit 3638cdc
Show file tree
Hide file tree
Showing 15 changed files with 209 additions and 280 deletions.
File renamed without changes.
9 changes: 4 additions & 5 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,12 @@ on:
branches:
- main
paths:
- 'Dockerfile'
- '.dockerignore'
- 'requirements.txt'
- 'setup.py'
- "Dockerfile"
- ".dockerignore"
- "pyproject.toml"
push:
tags:
- 'v*.*.*'
- "v*.*.*"

jobs:
build:
Expand Down
32 changes: 16 additions & 16 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ concurrency:
on:
pull_request:
branches:
- '*'
- "*"
push:
branches:
- main
tags:
- 'v*.*.*'
- "v*.*.*"

env:
CACHE_PREFIX: v3 # Change this to invalidate existing cache.
CACHE_PREFIX: v3 # Change this to invalidate existing cache.
PYTHON_PATH: ./
DEFAULT_PYTHON: 3.9
WANDB_API_KEY: ${{ secrets.WANDB_API_KEY }}
Expand All @@ -30,12 +30,12 @@ jobs:
runs-on: [ubuntu-latest]
timeout-minutes: 30
permissions:
contents: 'read'
id-token: 'write'
contents: "read"
id-token: "write"
strategy:
fail-fast: false
matrix:
python: ['3.9']
python: ["3.9"]
task:
- name: Lint
extras: dev,all
Expand All @@ -54,8 +54,7 @@ jobs:
requires_torch: true
run: |
tango --version
python setup.py check
python setup.py bdist_wheel sdist
python -m build
- name: Style
extras: dev
Expand Down Expand Up @@ -139,18 +138,18 @@ jobs:
requires_torch: false
run: |
pytest -v --durations=10 --color=yes --doctest-modules --ignore=tests/integrations --ignore=tango/integrations tests/ tango/
python: '3.8'
python: "3.8"

- task:
name: Test
extras: dev
requires_torch: false
run: |
pytest -v --durations=10 --color=yes --doctest-modules --ignore=tests/integrations --ignore=tango/integrations tests/ tango/
python: '3.10'
python: "3.10"

steps:
- uses: 'actions/checkout@v3'
- uses: "actions/checkout@v3"
- name: Checkout
if: github.event_name != 'pull_request'
uses: actions/checkout@v3
Expand Down Expand Up @@ -187,7 +186,7 @@ jobs:
id: virtualenv-cache
with:
path: .venv
key: ${{ env.CACHE_PREFIX }}-${{ env.WEEK_NUMBER }}-${{ runner.os }}-${{ env.RUNNER_ARCH }}-${{ env.PYTHON_VERSION }}-${{ env.EXTRAS_HASH }}-${{ hashFiles('*requirements.txt') }}
key: ${{ env.CACHE_PREFIX }}-${{ env.WEEK_NUMBER }}-${{ runner.os }}-${{ env.RUNNER_ARCH }}-${{ env.PYTHON_VERSION }}-${{ env.EXTRAS_HASH }}-${{ hashFiles('pyproject.toml') }}

- name: Setup virtual environment (no cache hit)
if: steps.virtualenv-cache.outputs.cache-hit != 'true'
Expand All @@ -196,10 +195,11 @@ jobs:
# Reference: https://github.com/marketplace/actions/authenticate-to-google-cloud#setup
- name: Authenticate to Google Cloud
uses: 'google-github-actions/auth@v1'
if: matrix.task.name == 'GS integration'
uses: "google-github-actions/auth@v1"
with:
workload_identity_provider: 'projects/10554368204/locations/global/workloadIdentityPools/tango-ci-pool/providers/tango-ci-provider'
service_account: '[email protected]'
workload_identity_provider: "projects/10554368204/locations/global/workloadIdentityPools/tango-ci-pool/providers/tango-ci-provider"
service_account: "[email protected]"

- name: Pre-install torch
if: steps.virtualenv-cache.outputs.cache-hit != 'true' && (contains(matrix.task.extras, 'torch') || contains(matrix.task.extras, 'all') || matrix.task.requires_torch)
Expand Down Expand Up @@ -317,7 +317,7 @@ jobs:

- name: Install requirements
run: |
pip install -r dev-requirements.txt
pip install -e .[dev]
- name: Prepare environment
run: |
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/update_dependency_pr.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
name: Update dependency PR
name: Update dependency PR

on:
pull_request:
types:
- opened
paths:
- 'requirements.txt'
- 'dev-requirements.txt'
- "pyproject.toml"

permissions:
pull-requests: write
Expand Down
6 changes: 4 additions & 2 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,7 @@ sphinx:
python:
version: "3.8"
install:
- requirements: requirements.txt
- requirements: dev-requirements.txt
- method: pip
path: .
extra_requirements:
- dev
5 changes: 1 addition & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,8 @@ FROM ${BASE_IMAGE}

WORKDIR /stage

COPY requirements.txt requirements.txt
RUN /opt/conda/bin/pip install --no-cache-dir -r requirements.txt

COPY . .
RUN /opt/conda/bin/pip install --no-cache-dir --no-deps .[all]
RUN /opt/conda/bin/pip install --no-cache-dir .[all]

WORKDIR /workspace

Expand Down
55 changes: 0 additions & 55 deletions dev-requirements.txt

This file was deleted.

2 changes: 1 addition & 1 deletion docs/source/CONTRIBUTING.md
10 changes: 0 additions & 10 deletions mypy.ini

This file was deleted.

Loading

0 comments on commit 3638cdc

Please sign in to comment.