Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
tchaton authored Feb 15, 2024
0 parents commit f4c30c7
Show file tree
Hide file tree
Showing 46 changed files with 1,982 additions and 0 deletions.
52 changes: 52 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# see https://docs.codecov.io/docs/codecov-yaml
# Validation check:
# $ curl --data-binary @.codecov.yml https://codecov.io/validate

# https://docs.codecov.io/docs/codecovyml-reference
codecov:
bot: "codecov-io"
strict_yaml_branch: "yaml-config"
require_ci_to_pass: yes
notify:
# after_n_builds: 2
wait_for_ci: yes

coverage:
precision: 0 # 2 = xx.xx%, 0 = xx%
round: nearest # how coverage is rounded: down/up/nearest
range: 40...100 # custom range of coverage colors from red -> yellow -> green
status:
# https://codecov.readme.io/v1.0/docs/commit-status
project:
default:
target: 99% # specify the target coverage for each commit status
threshold: 30% # allow this little decrease on project
# https://github.com/codecov/support/wiki/Filtering-Branches
# branches: main
if_ci_failed: error
# https://github.com/codecov/support/wiki/Patch-Status
patch:
default:
target: 50% # specify the target "X%" coverage to hit
# threshold: 50% # allow this much decrease on patch
changes: false

# https://docs.codecov.com/docs/github-checks#disabling-github-checks-patch-annotations
github_checks:
annotations: false

parsers:
gcov:
branch_detection:
conditional: true
loop: true
macro: false
method: false
javascript:
enable_partials: false

comment:
layout: header, diff
require_changes: false
behavior: default # update if exists else create new
# branches: *
9 changes: 9 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Each line is a file pattern followed by one or more owners.

# These owners will be the default owners for everything in the repo. Unless a later match takes precedence,
# @global-owner1 and @global-owner2 will be requested for review when someone opens a pull request.
* @borda

# CI/CD and configs
/.github/ @borda
*.yml @borda
46 changes: 46 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: bug, help wanted
assignees: ''
---

## 🐛 Bug

<!-- A clear and concise description of what the bug is. -->

### To Reproduce

Steps to reproduce the behavior:

1. Go to '...'
1. Run '....'
1. Scroll down to '....'
1. See error

<!-- If you have a code sample, error messages, stack traces, please provide it here as well -->

#### Code sample

<!-- Ideally attach a minimal code sample to reproduce the decried issue.
Minimal means having the shortest code but still preserving the bug. -->

### Expected behavior

<!-- A clear and concise description of what you expected to happen. -->

### Environment

- PyTorch Version (e.g., 1.0):
- OS (e.g., Linux):
- How you installed PyTorch (`conda`, `pip`, source):
- Build command you used (if compiling from source):
- Python version:
- CUDA/cuDNN version:
- GPU models and configuration:
- Any other relevant information:

### Additional context

<!-- Add any other context about the problem here. -->
17 changes: 17 additions & 0 deletions .github/ISSUE_TEMPLATE/documentation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
name: Typos and doc fixes
about: Typos and doc fixes
title: ''
labels: documentation
assignees: ''
---

## 📚 Documentation

For typos and doc fixes, please go ahead and:

1. Create an issue.
1. Fix the typo.
1. Submit a PR.

Thanks!
27 changes: 27 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: enhancement, help wanted
assignees: ''
---

## 🚀 Feature

<!-- A clear and concise description of the feature proposal -->

### Motivation

<!-- Please outline the motivation for the proposal. Is your feature request related to a problem? e.g., I'm always frustrated when [...]. If this is related to another GitHub issue, please link here too -->

### Pitch

<!-- A clear and concise description of what you want to happen. -->

### Alternatives

<!-- A clear and concise description of any alternative solutions or features you've considered, if any. -->

### Additional context

<!-- Add any other context or screenshots about the feature request here. -->
22 changes: 22 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<details>
<summary><b>Before submitting</b></summary>

- [ ] Was this discussed/agreed via a Github issue? (no need for typos and docs improvements)
- [ ] Did you read the [contributor guideline](https://github.com/Lightning-AI/pytorch-lightning/blob/main/.github/CONTRIBUTING.md), Pull Request section?
- [ ] Did you make sure to update the docs?
- [ ] Did you write any new necessary tests?

</details>

## What does this PR do?

Fixes # (issue).

## PR review

Anyone in the community is free to review the PR once the tests have passed.
If we didn't discuss your PR in GitHub issues there's a high chance it will not be merged.

## Did you have fun?

Make sure you had fun coding 🙃
41 changes: 41 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Basic dependabot.yml file with
# minimum configuration for two package managers

version: 2
updates:
# Enable version updates for python
- package-ecosystem: "pip"
# Look for a `requirements` in the `root` directory
directory: "/"
# Check for updates once a week
schedule:
interval: "monthly"
# Labels on pull requests for version updates only
labels:
- "ci / tests"
pull-request-branch-name:
# Separate sections of the branch name with a hyphen
# for example, `dependabot-npm_and_yarn-next_js-acorn-6.4.1`
separator: "-"
# Allow up to 5 open pull requests for pip dependencies
open-pull-requests-limit: 5
reviewers:
- "Borda"

# Enable version updates for GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
# Check for updates once a week
schedule:
interval: "weekly"
# Labels on pull requests for version updates only
labels:
- "ci / tests"
pull-request-branch-name:
# Separate sections of the branch name with a hyphen
# for example, `dependabot-npm_and_yarn-next_js-acorn-6.4.1`
separator: "-"
# Allow up to 5 open pull requests for GitHub Actions
open-pull-requests-limit: 5
reviewers:
- "Borda"
26 changes: 26 additions & 0 deletions .github/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# https://github.com/marketplace/stale

# Number of days of inactivity before an issue becomes stale
daysUntilStale: 60
# Number of days of inactivity before a stale issue is closed
daysUntilClose: 14
# Issues with these labels will never be considered stale
exemptLabels:
- pinned
- security
# Label to use when marking an issue as stale
staleLabel: won't fix
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. Thank you
for your contributions.
# Comment to post when closing a stale issue. Set to `false` to disable
closeComment: false

# Set to true to ignore issues in a project (defaults to false)
exemptProjects: true
# Set to true to ignore issues in a milestone (defaults to false)
exemptMilestones: true
# Set to true to ignore issues with an assignee (defaults to false)
exemptAssignees: true
42 changes: 42 additions & 0 deletions .github/workflows/ci-checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: General checks

on:
push:
branches: [main, "release/*"]
pull_request:
branches: [main, "release/*"]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref }}
cancel-in-progress: ${{ ! (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/')) }}

jobs:
check-precommit:
uses: Lightning-AI/utilities/.github/workflows/check-precommit.yml@main

check-typing:
uses: Lightning-AI/utilities/.github/workflows/check-typing.yml@main
with:
actions-ref: main

check-schema:
uses: Lightning-AI/utilities/.github/workflows/check-schema.yml@main
with:
azure-dir: ""

check-package:
uses: Lightning-AI/utilities/.github/workflows/check-package.yml@main
with:
actions-ref: main
import-name: "pl_sandbox"
artifact-name: dist-packages-${{ github.sha }}
testing-matrix: |
{
"os": ["ubuntu-latest", "macos-latest", "windows-latest"],
"python-version": ["3.8", "3.10"]
}
check-docs:
uses: Lightning-AI/utilities/.github/workflows/check-docs.yml@main
with:
requirements-file: "_requirements/docs.txt"
84 changes: 84 additions & 0 deletions .github/workflows/ci-testing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: CI testing

# see: https://help.github.com/en/actions/reference/events-that-trigger-workflows
on: # Trigger the workflow on push or pull request, but only for the main branch
push: {}
pull_request:
branches: [main]

defaults:
run:
shell: bash

jobs:
pytest:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
python-version: [3.9]
requires: ["oldest", "latest"]

# Timeout: https://stackoverflow.com/a/59076067/4521646
timeout-minutes: 35
env:
TORCH_URL: "https://download.pytorch.org/whl/cpu/torch_stable.html"

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

# Github Actions: Run step on specific OS: https://stackoverflow.com/a/57948488/4521646
#- name: Setup macOS
# if: runner.os == 'macOS'
# run: |
# brew install libomp # https://github.com/pytorch/pytorch/issues/20030

- name: Set min. dependencies
if: matrix.requires == 'oldest'
run: |
for fpath in ('requirements.txt', '_requirements/test.txt'):
req = open(fpath).read().replace('>=', '==')
open(fpath, 'w').write(req)
shell: python

- name: Get pip cache dir
id: pip-cache
run: echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT

- name: Cache pip
uses: actions/cache@v4
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.requires }}-pip-${{ hashFiles('requirements.txt') }}
restore-keys: ${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.requires }}-pip-

- name: Install package & dependencies
run: |
pip --version
pip install -e '.[test]' -U -q --find-links $TORCH_URL
pip list
- name: Tests
run: |
coverage run --source pl_sandbox -m pytest src tests -v
- name: Statistics
if: success()
run: |
coverage report
coverage xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
flags: unittests
env_vars: OS,PYTHON
name: codecov-umbrella
fail_ci_if_error: false
Loading

0 comments on commit f4c30c7

Please sign in to comment.