Skip to content

Commit

Permalink
Merge branch 'brainpy:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
PraPaudel authored Nov 26, 2023
2 parents 3d0cb7a + d892de7 commit 0d9c03f
Show file tree
Hide file tree
Showing 465 changed files with 35,825 additions and 17,085 deletions.
26 changes: 26 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "daily"
allow:
- dependency-type: "all"
commit-message:
prefix: ":arrow_up:"
open-pull-requests-limit: 50

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
allow:
- dependency-type: "all"
commit-message:
prefix: ":arrow_up:"
open-pull-requests-limit: 50
41 changes: 21 additions & 20 deletions .github/workflows/CI-models.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ on:
push:
branches:
- '**' # matches every branch
pull_request:
branches:
- '**' # matches every branch


#
Expand All @@ -16,20 +19,20 @@ on:
jobs:
test_linux:
runs-on: ubuntu-latest
if: github.event.pull_request.merged == true
strategy:
fail-fast: false
matrix:
python-version: [ "3.8", "3.9", "3.10", "3.11"]
python-version: [ "3.9", "3.10", "3.11"]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip install taichi-nightly -i https://pypi.taichi.graphics/simple/
if [ -f requirements-dev.txt ]; then pip install -r requirements-dev.txt; fi
pip uninstall brainpy -y
python setup.py install
Expand All @@ -46,9 +49,9 @@ jobs:
# python-version: ["3.7"]
#
# steps:
# - uses: actions/checkout@v2
# - uses: actions/checkout@v4
# - name: Set up Python ${{ matrix.python-version }}
# uses: actions/setup-python@v2
# uses: actions/setup-python@v4
# with:
# python-version: ${{ matrix.python-version }}
# - name: Install dependencies
Expand All @@ -64,20 +67,20 @@ jobs:

test_macos:
runs-on: macos-latest
if: github.event.pull_request.merged == true
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: [ "3.9", "3.10", "3.11"]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip install taichi-nightly -i https://pypi.taichi.graphics/simple/
if [ -f requirements-dev.txt ]; then pip install -r requirements-dev.txt; fi
pip uninstall brainpy -y
python setup.py install
Expand All @@ -94,9 +97,9 @@ jobs:
# python-version: [ "3.7" ]
#
# steps:
# - uses: actions/checkout@v2
# - uses: actions/checkout@v4
# - name: Set up Python ${{ matrix.python-version }}
# uses: actions/setup-python@v2
# uses: actions/setup-python@v4
# with:
# python-version: ${{ matrix.python-version }}
# - name: Install dependencies
Expand All @@ -113,23 +116,21 @@ jobs:

test_windows:
runs-on: windows-latest
if: github.event.pull_request.merged == true
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: ["3.9", "3.10", "3.11"]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install numpy>=1.21.0
python -m pip install "jaxlib==0.4.10" -f https://whls.blob.core.windows.net/unstable/index.html --use-deprecated legacy-resolver
python -m pip install jax==0.4.10
pip install taichi-nightly -i https://pypi.taichi.graphics/simple/
python -m pip install -r requirements-dev.txt
python -m pip install tqdm brainpylib
pip uninstall brainpy -y
Expand All @@ -147,9 +148,9 @@ jobs:
# python-version: ["3.7"]
#
# steps:
# - uses: actions/checkout@v2
# - uses: actions/checkout@v4
# - name: Set up Python ${{ matrix.python-version }}
# uses: actions/setup-python@v2
# uses: actions/setup-python@v4
# with:
# python-version: ${{ matrix.python-version }}
# - name: Install dependencies
Expand Down
97 changes: 51 additions & 46 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ on:
push:
branches:
- '**' # matches every branch
pull_request:
branches:
- '**' # matches every branch

#on:
# push:
Expand All @@ -21,18 +24,19 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [ "3.8", "3.9", "3.10", "3.11"]
python-version: [ "3.9", "3.10", "3.11"]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest
pip install taichi-nightly -i https://pypi.taichi.graphics/simple/
if [ -f requirements-dev.txt ]; then pip install -r requirements-dev.txt; fi
pip uninstall brainpy -y
python setup.py install
Expand All @@ -56,9 +60,9 @@ jobs:
# python-version: ["3.7"]
#
# steps:
# - uses: actions/checkout@v2
# - uses: actions/checkout@v4
# - name: Set up Python ${{ matrix.python-version }}
# uses: actions/setup-python@v2
# uses: actions/setup-python@v4
# with:
# python-version: ${{ matrix.python-version }}
# - name: Install dependencies
Expand Down Expand Up @@ -87,18 +91,19 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: ["3.9", "3.10", "3.11"]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest
pip install taichi-nightly -i https://pypi.taichi.graphics/simple/
if [ -f requirements-dev.txt ]; then pip install -r requirements-dev.txt; fi
pip uninstall brainpy -y
python setup.py install
Expand All @@ -121,9 +126,9 @@ jobs:
# python-version: [ "3.7" ]
#
# steps:
# - uses: actions/checkout@v2
# - uses: actions/checkout@v4
# - name: Set up Python ${{ matrix.python-version }}
# uses: actions/setup-python@v2
# uses: actions/setup-python@v4
# with:
# python-version: ${{ matrix.python-version }}
# - name: Install dependencies
Expand All @@ -148,40 +153,40 @@ jobs:
#


test_windows:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest
python -m pip install numpy>=1.21.0
python -m pip install "jaxlib==0.4.10" -f https://whls.blob.core.windows.net/unstable/index.html --use-deprecated legacy-resolver
python -m pip install jax==0.4.10
python -m pip install -r requirements-dev.txt
python -m pip install tqdm brainpylib
pip uninstall brainpy -y
python setup.py install
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 brainpy/ --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 brainpy/ --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
cd brainpy
pytest _src/
# test_windows:
# runs-on: windows-latest
# strategy:
# fail-fast: false
# matrix:
# python-version: ["3.8", "3.9", "3.10", "3.11"]
#
# steps:
# - uses: actions/checkout@v4
# - name: Set up Python ${{ matrix.python-version }}
# uses: actions/setup-python@v4
# with:
# python-version: ${{ matrix.python-version }}
# - name: Install dependencies
# run: |
# python -m pip install --upgrade pip
# python -m pip install flake8 pytest
# python -m pip install numpy>=1.21.0
# python -m pip install "jaxlib==0.4.11" -f https://whls.blob.core.windows.net/unstable/index.html --use-deprecated legacy-resolver
# python -m pip install jax==0.4.11
# python -m pip install -r requirements-dev.txt
# python -m pip install tqdm brainpylib
# pip uninstall brainpy -y
# python setup.py install
# - name: Lint with flake8
# run: |
# # stop the build if there are Python syntax errors or undefined names
# flake8 brainpy/ --count --select=E9,F63,F7,F82 --show-source --statistics
# # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
# flake8 brainpy/ --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
# - name: Test with pytest
# run: |
# cd brainpy
# pytest _src/


# test_windows_py37:
Expand All @@ -192,9 +197,9 @@ jobs:
# python-version: ["3.7"]
#
# steps:
# - uses: actions/checkout@v2
# - uses: actions/checkout@v4
# - name: Set up Python ${{ matrix.python-version }}
# uses: actions/setup-python@v2
# uses: actions/setup-python@v4
# with:
# python-version: ${{ matrix.python-version }}
# - name: Install dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/Publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
- run: python setup.py bdist_wheel
Expand Down
59 changes: 59 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Docker

on:
release:
types: [published]
pull_request:
paths:
- docker/**
- .github/workflows/docker.yml


jobs:
docker-build-push:
if: |
github.repository_owner == 'brainpy' ||
github.event_name != 'release'
runs-on: ubuntu-22.04
strategy:
matrix:
include:
- context: "docker/"
base: "brainpy/brainpy"
env:
TARGET_PLATFORMS: linux/amd64
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
DOCKER_TAG_NAME: |
${{
(github.event_name == 'release' && github.event.release.tag_name) ||
'pull-request-test'
}}
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Docker Build & Push (version tag)
uses: docker/build-push-action@v5
with:
context: ${{ matrix.context }}
tags: ${{ matrix.base }}:${{ env.DOCKER_TAG_NAME }}
push: ${{ github.event_name != 'pull_request' }}
platforms: ${{ env.TARGET_PLATFORMS }}

- name: Docker Build & Push (latest tag)
if: |
(github.event_name == 'release' && ! github.event.release.prerelease)
uses: docker/build-push-action@v5
with:
context: ${{ matrix.context }}
tags: ${{ matrix.base }}:latest
push: ${{ github.event_name != 'pull_request' }}
platforms: ${{ env.TARGET_PLATFORMS }}
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
labels: self-hosted

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
Expand Down
Loading

0 comments on commit 0d9c03f

Please sign in to comment.