Skip to content

Commit f4c30c7

Browse files
authored
Initial commit
0 parents  commit f4c30c7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+1982
-0
lines changed

.codecov.yml

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# see https://docs.codecov.io/docs/codecov-yaml
2+
# Validation check:
3+
# $ curl --data-binary @.codecov.yml https://codecov.io/validate
4+
5+
# https://docs.codecov.io/docs/codecovyml-reference
6+
codecov:
7+
bot: "codecov-io"
8+
strict_yaml_branch: "yaml-config"
9+
require_ci_to_pass: yes
10+
notify:
11+
# after_n_builds: 2
12+
wait_for_ci: yes
13+
14+
coverage:
15+
precision: 0 # 2 = xx.xx%, 0 = xx%
16+
round: nearest # how coverage is rounded: down/up/nearest
17+
range: 40...100 # custom range of coverage colors from red -> yellow -> green
18+
status:
19+
# https://codecov.readme.io/v1.0/docs/commit-status
20+
project:
21+
default:
22+
target: 99% # specify the target coverage for each commit status
23+
threshold: 30% # allow this little decrease on project
24+
# https://github.com/codecov/support/wiki/Filtering-Branches
25+
# branches: main
26+
if_ci_failed: error
27+
# https://github.com/codecov/support/wiki/Patch-Status
28+
patch:
29+
default:
30+
target: 50% # specify the target "X%" coverage to hit
31+
# threshold: 50% # allow this much decrease on patch
32+
changes: false
33+
34+
# https://docs.codecov.com/docs/github-checks#disabling-github-checks-patch-annotations
35+
github_checks:
36+
annotations: false
37+
38+
parsers:
39+
gcov:
40+
branch_detection:
41+
conditional: true
42+
loop: true
43+
macro: false
44+
method: false
45+
javascript:
46+
enable_partials: false
47+
48+
comment:
49+
layout: header, diff
50+
require_changes: false
51+
behavior: default # update if exists else create new
52+
# branches: *

.github/CODEOWNERS

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Each line is a file pattern followed by one or more owners.
2+
3+
# These owners will be the default owners for everything in the repo. Unless a later match takes precedence,
4+
# @global-owner1 and @global-owner2 will be requested for review when someone opens a pull request.
5+
* @borda
6+
7+
# CI/CD and configs
8+
/.github/ @borda
9+
*.yml @borda

.github/ISSUE_TEMPLATE/bug_report.md

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: bug, help wanted
6+
assignees: ''
7+
---
8+
9+
## 🐛 Bug
10+
11+
<!-- A clear and concise description of what the bug is. -->
12+
13+
### To Reproduce
14+
15+
Steps to reproduce the behavior:
16+
17+
1. Go to '...'
18+
1. Run '....'
19+
1. Scroll down to '....'
20+
1. See error
21+
22+
<!-- If you have a code sample, error messages, stack traces, please provide it here as well -->
23+
24+
#### Code sample
25+
26+
<!-- Ideally attach a minimal code sample to reproduce the decried issue.
27+
Minimal means having the shortest code but still preserving the bug. -->
28+
29+
### Expected behavior
30+
31+
<!-- A clear and concise description of what you expected to happen. -->
32+
33+
### Environment
34+
35+
- PyTorch Version (e.g., 1.0):
36+
- OS (e.g., Linux):
37+
- How you installed PyTorch (`conda`, `pip`, source):
38+
- Build command you used (if compiling from source):
39+
- Python version:
40+
- CUDA/cuDNN version:
41+
- GPU models and configuration:
42+
- Any other relevant information:
43+
44+
### Additional context
45+
46+
<!-- Add any other context about the problem here. -->
+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
name: Typos and doc fixes
3+
about: Typos and doc fixes
4+
title: ''
5+
labels: documentation
6+
assignees: ''
7+
---
8+
9+
## 📚 Documentation
10+
11+
For typos and doc fixes, please go ahead and:
12+
13+
1. Create an issue.
14+
1. Fix the typo.
15+
1. Submit a PR.
16+
17+
Thanks!
+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: enhancement, help wanted
6+
assignees: ''
7+
---
8+
9+
## 🚀 Feature
10+
11+
<!-- A clear and concise description of the feature proposal -->
12+
13+
### Motivation
14+
15+
<!-- 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 -->
16+
17+
### Pitch
18+
19+
<!-- A clear and concise description of what you want to happen. -->
20+
21+
### Alternatives
22+
23+
<!-- A clear and concise description of any alternative solutions or features you've considered, if any. -->
24+
25+
### Additional context
26+
27+
<!-- Add any other context or screenshots about the feature request here. -->

.github/PULL_REQUEST_TEMPLATE.md

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<details>
2+
<summary><b>Before submitting</b></summary>
3+
4+
- [ ] Was this discussed/agreed via a Github issue? (no need for typos and docs improvements)
5+
- [ ] Did you read the [contributor guideline](https://github.com/Lightning-AI/pytorch-lightning/blob/main/.github/CONTRIBUTING.md), Pull Request section?
6+
- [ ] Did you make sure to update the docs?
7+
- [ ] Did you write any new necessary tests?
8+
9+
</details>
10+
11+
## What does this PR do?
12+
13+
Fixes # (issue).
14+
15+
## PR review
16+
17+
Anyone in the community is free to review the PR once the tests have passed.
18+
If we didn't discuss your PR in GitHub issues there's a high chance it will not be merged.
19+
20+
## Did you have fun?
21+
22+
Make sure you had fun coding 🙃

.github/dependabot.yml

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Basic dependabot.yml file with
2+
# minimum configuration for two package managers
3+
4+
version: 2
5+
updates:
6+
# Enable version updates for python
7+
- package-ecosystem: "pip"
8+
# Look for a `requirements` in the `root` directory
9+
directory: "/"
10+
# Check for updates once a week
11+
schedule:
12+
interval: "monthly"
13+
# Labels on pull requests for version updates only
14+
labels:
15+
- "ci / tests"
16+
pull-request-branch-name:
17+
# Separate sections of the branch name with a hyphen
18+
# for example, `dependabot-npm_and_yarn-next_js-acorn-6.4.1`
19+
separator: "-"
20+
# Allow up to 5 open pull requests for pip dependencies
21+
open-pull-requests-limit: 5
22+
reviewers:
23+
- "Borda"
24+
25+
# Enable version updates for GitHub Actions
26+
- package-ecosystem: "github-actions"
27+
directory: "/"
28+
# Check for updates once a week
29+
schedule:
30+
interval: "weekly"
31+
# Labels on pull requests for version updates only
32+
labels:
33+
- "ci / tests"
34+
pull-request-branch-name:
35+
# Separate sections of the branch name with a hyphen
36+
# for example, `dependabot-npm_and_yarn-next_js-acorn-6.4.1`
37+
separator: "-"
38+
# Allow up to 5 open pull requests for GitHub Actions
39+
open-pull-requests-limit: 5
40+
reviewers:
41+
- "Borda"

.github/stale.yml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# https://github.com/marketplace/stale
2+
3+
# Number of days of inactivity before an issue becomes stale
4+
daysUntilStale: 60
5+
# Number of days of inactivity before a stale issue is closed
6+
daysUntilClose: 14
7+
# Issues with these labels will never be considered stale
8+
exemptLabels:
9+
- pinned
10+
- security
11+
# Label to use when marking an issue as stale
12+
staleLabel: won't fix
13+
# Comment to post when marking an issue as stale. Set to `false` to disable
14+
markComment: >
15+
This issue has been automatically marked as stale because it has not had
16+
recent activity. It will be closed if no further activity occurs. Thank you
17+
for your contributions.
18+
# Comment to post when closing a stale issue. Set to `false` to disable
19+
closeComment: false
20+
21+
# Set to true to ignore issues in a project (defaults to false)
22+
exemptProjects: true
23+
# Set to true to ignore issues in a milestone (defaults to false)
24+
exemptMilestones: true
25+
# Set to true to ignore issues with an assignee (defaults to false)
26+
exemptAssignees: true

.github/workflows/ci-checks.yml

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: General checks
2+
3+
on:
4+
push:
5+
branches: [main, "release/*"]
6+
pull_request:
7+
branches: [main, "release/*"]
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref }}
11+
cancel-in-progress: ${{ ! (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/')) }}
12+
13+
jobs:
14+
check-precommit:
15+
uses: Lightning-AI/utilities/.github/workflows/check-precommit.yml@main
16+
17+
check-typing:
18+
uses: Lightning-AI/utilities/.github/workflows/check-typing.yml@main
19+
with:
20+
actions-ref: main
21+
22+
check-schema:
23+
uses: Lightning-AI/utilities/.github/workflows/check-schema.yml@main
24+
with:
25+
azure-dir: ""
26+
27+
check-package:
28+
uses: Lightning-AI/utilities/.github/workflows/check-package.yml@main
29+
with:
30+
actions-ref: main
31+
import-name: "pl_sandbox"
32+
artifact-name: dist-packages-${{ github.sha }}
33+
testing-matrix: |
34+
{
35+
"os": ["ubuntu-latest", "macos-latest", "windows-latest"],
36+
"python-version": ["3.8", "3.10"]
37+
}
38+
39+
check-docs:
40+
uses: Lightning-AI/utilities/.github/workflows/check-docs.yml@main
41+
with:
42+
requirements-file: "_requirements/docs.txt"

.github/workflows/ci-testing.yml

+84
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
name: CI testing
2+
3+
# see: https://help.github.com/en/actions/reference/events-that-trigger-workflows
4+
on: # Trigger the workflow on push or pull request, but only for the main branch
5+
push: {}
6+
pull_request:
7+
branches: [main]
8+
9+
defaults:
10+
run:
11+
shell: bash
12+
13+
jobs:
14+
pytest:
15+
runs-on: ${{ matrix.os }}
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
os: [ubuntu-latest, macOS-latest, windows-latest]
20+
python-version: [3.9]
21+
requires: ["oldest", "latest"]
22+
23+
# Timeout: https://stackoverflow.com/a/59076067/4521646
24+
timeout-minutes: 35
25+
env:
26+
TORCH_URL: "https://download.pytorch.org/whl/cpu/torch_stable.html"
27+
28+
steps:
29+
- uses: actions/checkout@v4
30+
- name: Set up Python ${{ matrix.python-version }}
31+
uses: actions/setup-python@v5
32+
with:
33+
python-version: ${{ matrix.python-version }}
34+
35+
# Github Actions: Run step on specific OS: https://stackoverflow.com/a/57948488/4521646
36+
#- name: Setup macOS
37+
# if: runner.os == 'macOS'
38+
# run: |
39+
# brew install libomp # https://github.com/pytorch/pytorch/issues/20030
40+
41+
- name: Set min. dependencies
42+
if: matrix.requires == 'oldest'
43+
run: |
44+
for fpath in ('requirements.txt', '_requirements/test.txt'):
45+
req = open(fpath).read().replace('>=', '==')
46+
open(fpath, 'w').write(req)
47+
shell: python
48+
49+
- name: Get pip cache dir
50+
id: pip-cache
51+
run: echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT
52+
53+
- name: Cache pip
54+
uses: actions/cache@v4
55+
with:
56+
path: ${{ steps.pip-cache.outputs.dir }}
57+
key: ${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.requires }}-pip-${{ hashFiles('requirements.txt') }}
58+
restore-keys: ${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.requires }}-pip-
59+
60+
- name: Install package & dependencies
61+
run: |
62+
pip --version
63+
pip install -e '.[test]' -U -q --find-links $TORCH_URL
64+
pip list
65+
66+
- name: Tests
67+
run: |
68+
coverage run --source pl_sandbox -m pytest src tests -v
69+
70+
- name: Statistics
71+
if: success()
72+
run: |
73+
coverage report
74+
coverage xml
75+
76+
- name: Upload coverage to Codecov
77+
uses: codecov/codecov-action@v4
78+
with:
79+
token: ${{ secrets.CODECOV_TOKEN }}
80+
file: ./coverage.xml
81+
flags: unittests
82+
env_vars: OS,PYTHON
83+
name: codecov-umbrella
84+
fail_ci_if_error: false

0 commit comments

Comments
 (0)