Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release v0.3.0 #279

Merged
merged 4 commits into from
May 31, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
7 changes: 7 additions & 0 deletions .bandit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
### profile may optionally select or skip tests

# (optional) list included tests here:
tests: []

# (optional) list skipped tests here:
skips: ['B101', 'B403', 'B404', 'B603', 'B607', 'B301', 'B303', 'B311', 'B310', 'B506']
28 changes: 28 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
name: Bug report
about: Create a bug report to help us improve
title: 'Bug Summary'
labels: ''
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. ...
2. ...
3. ...

**Expected behavior**
A clear and concise description of what you expected to happen.

**System [please complete the following information]:**
- OS: e.g. [Ubuntu 20.04]
- Language Version: [e.g. Python 3.9]
- Virtual environment: [e.g. Conda]

**Additional context**
Add any other context about the problem here.
17 changes: 17 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
name: Feature request
about: Suggest a new feature
title: 'Feature Request Summary'
labels: ''
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when ...

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Additional context**
Add any other context or screenshots about the feature request here.
13 changes: 13 additions & 0 deletions .github/ISSUE_TEMPLATE/general_question.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
name: General question
about: Ask a question about anything related to this project
title: 'Question'
labels: ''
assignees: ''

---

**Question**

Please ask your question here. It can be about the usage of this project, the internals, the implementation or whatever interests you.
Please use the BUG template for bugs, and the FEATURE REQUEST template for feature requests.
25 changes: 25 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
version: 2
updates:
- package-ecosystem: pip
directory: "/"
schedule:
interval: daily
time: "04:00"
open-pull-requests-limit: 99
target-branch: development
labels:
- dependabot
commit-message:
prefix: "[DEPENDABOT]"

- package-ecosystem: github-actions
directory: "/"
schedule:
interval: daily
time: "04:00"
open-pull-requests-limit: 99
target-branch: development
labels:
- dependabot
commit-message:
prefix: "[DEPENDABOT]"
19 changes: 19 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Many thanks for contributing to sfaira!

**PR Checklist**
Please fill in the appropriate checklist below (delete whatever is not relevant). These are the most common things requested on pull requests (PRs).

- [ ] This comment contains a description of changes (with reason)
- [ ] Referenced issue is linked
- [ ] If you've fixed a bug or added code that should be tested, add tests!
- [ ] Documentation in `docs` is updated
- [ ] `docs/release-notes.rst` is updated

**Description of changes**
Please state what you've changed and how it might affect the user.

**Technical details**
Please state any technical details such as limitations, reasons for additional dependencies, benchmarks etc. here.

**Additional context**
Add any other context or screenshots here.
42 changes: 42 additions & 0 deletions .github/workflows/build_package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Build sfaira Package

on: [push, pull_request]

jobs:
build:
runs-on: ${{ matrix.os }}
if: "!contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.head_commit.message, '[ci skip]')"
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
python: [3.7, 3.8]
env:
PYTHONIOENCODING: utf-8

steps:
- uses: actions/checkout@v2
name: Check out source-code repository

- name: Setup Python
uses: actions/setup-python@v2.1.4
with:
python-version: ${{ matrix.python }}

- name: Upgrade and install pip
run: python -m pip install --upgrade pip

- name: Build sfaira
run: pip install .

- name: Import sfaira
run: python -c "import sfaira"

# Verify that the package does adhere to PyPI's standards
- name: Install required twine packaging dependencies
run: pip install setuptools wheel twine

- name: Build twine package
run: python setup.py sdist bdist_wheel

- name: Check twine package
run: twine check dist/*
35 changes: 35 additions & 0 deletions .github/workflows/create_templates.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Create sfaira data-loader templates

on: [push, pull_request]

jobs:
create-templates:
runs-on: ${{ matrix.os }}
if: "!contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.head_commit.message, '[ci skip]')"
strategy:
matrix:
os: [ubuntu-latest]
python: [3.7, 3.8]
env:
PYTHONIOENCODING: utf-8

steps:
- uses: actions/checkout@v2
name: Check out source-code repository

- name: Setup Python
uses: actions/setup-python@v2.1.4
with:
python-version: ${{ matrix.python }}

- name: Upgrade and install pip
run: python -m pip install --upgrade pip

- name: Build sfaira
run: pip install .

- name: Create single_dataset template
run: |
cd ..
echo -e "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n" | sfaira create-dataloader
rm -rf d10_1000_j_journal_2021_01_001/
34 changes: 34 additions & 0 deletions .github/workflows/pr_to_master_from_patch_release_only.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: PR to master branch from patch/release branch only

on:
pull_request:
branches:
- master

jobs:
test:
runs-on: ubuntu-latest
steps:
# PRs to the repository master branch are only ok if coming from any patch or release branch
- name: Check PRs
run: |
{ [[ $GITHUB_HEAD_REF = *"release"* ]]; } || [[ $GITHUB_HEAD_REF == *"patch"* ]]

# If the above check failed, post a comment on the PR explaining the failure
# NOTE - this may not work if the PR is coming from a fork, due to limitations in GitHub actions secrets
- name: Post PR comment
if: failure()
uses: mshick/add-pr-comment@v1
with:
message: |
Hi @${{ github.event.pull_request.user.login }},

It looks like this pull-request is has been made against the ${{github.event.pull_request.head.repo.full_name}} `master` branch.
The `master` branch should always contain code from the latest release.
Because of this, PRs to `master` are only allowed if they come from any ${{github.event.pull_request.head.repo.full_name}} `release` or `patch` branch.

You do not need to close this PR, you can change the target branch to `development` by clicking the _"Edit"_ button at the top of this page.

Thanks again for your contribution!
repo-token: ${{ secrets.GITHUB_TOKEN }}
allow-repeats: false
42 changes: 42 additions & 0 deletions .github/workflows/publish_docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Build Documentation

on:
push:
paths:
- "docs/**"
pull_request:
paths:
- "docs/**"

jobs:
build:

runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.head_commit.message, '[ci skip]')"

steps:
- uses: actions/checkout@v2
name: Check out source-code repository

- name: Setup Python
uses: actions/setup-python@v2.1.4
with:
python-version: 3.8

- name: Install pip
run: python -m pip install --upgrade pip

- name: Install doc dependencies
run: pip install -r docs/requirements.txt

- name: Build docs
run: |
cd docs
make html

- name: Deploy
if: ${{ github.ref == 'refs/heads/master' && github.event_name == 'push' }}
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/_build/html
31 changes: 31 additions & 0 deletions .github/workflows/publish_package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Publish sfaira to PyPI

on:
release:
types: [created]

jobs:
deploy:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.head_commit.message, '[ci skip]')"
steps:
- uses: actions/checkout@v2
name: Check out source-code repository

- name: Set up Python
uses: actions/setup-python@v2.1.4
with:
python-version: '3.9'

- name: Install pip, setuptools, wheel, twine
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine

- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
30 changes: 30 additions & 0 deletions .github/workflows/run_bandit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Run bandit

on:
push:
paths:
- "**/*.py"
pull_request:
paths:
- "**/*.py"

jobs:
run-bandit:

runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.head_commit.message, '[ci skip]')"

steps:
- uses: actions/checkout@v2
name: Check out source-code repository

- name: Setup Python
uses: actions/setup-python@v2.1.4
with:
python-version: 3.9

- name: Install bandit
run: pip install bandit

- name: Run bandit
run: bandit -r sfaira -c .bandit.yml
31 changes: 31 additions & 0 deletions .github/workflows/run_flake8_linting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Run flake8 linting

on:
push:
paths:
- "**/*.py"
pull_request:
paths:
- "**/*.py"

jobs:
lint:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.head_commit.message, '[ci skip]')"

steps:
- uses: actions/checkout@v2
name: Check out source-code repository

- name: Setup Python
uses: actions/setup-python@v2.1.4
with:
python-version: 3.9

- name: Install pip
run: python -m pip install --upgrade pip

- name: Lint with flake8
run: |
pip install flake8
flake8 .
Loading