-
Notifications
You must be signed in to change notification settings - Fork 273
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
Update CI to follow gymnasium's implementation #418
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: build | ||
on: [pull_request, push] | ||
|
||
permissions: | ||
contents: read # to fetch code (actions/checkout) | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: ['3.8', '3.9', '3.10', '3.11'] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- run: | | ||
docker build -f docker/Dockerfile \ | ||
--build-arg PYTHON_VERSION=${{ matrix.python-version }} \ | ||
--tag metaworld-docker . | ||
- name: Run tests | ||
run: docker run metaworld-docker pytest tests/* | ||
# - name: Run doctests | ||
# run: docker run metaworld-docker pytest --doctest-modules metaworld/ |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,21 @@ | ||
# https://pre-commit.com | ||
# This GitHub Action assumes that the repo contains a valid .pre-commit-config.yaml file. | ||
--- | ||
name: pre-commit | ||
on: | ||
pull_request: | ||
push: | ||
branches: [master] | ||
|
||
permissions: | ||
contents: read | ||
contents: read # to fetch code (actions/checkout) | ||
|
||
jobs: | ||
pre-commit: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v3 | ||
- run: pip install pre-commit | ||
- run: pre-commit --version | ||
- run: pre-commit install | ||
- run: pre-commit run --all-files | ||
- uses: actions/setup-python@v4 | ||
- run: python -m pip install pre-commit | ||
- run: python -m pre_commit --version | ||
- run: python -m pre_commit install | ||
- run: python -m pre_commit run --all-files |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,60 @@ | ||
--- | ||
# See https://pre-commit.com for more information | ||
# See https://pre-commit.com/hooks.html for more hooks | ||
repos: | ||
- repo: https://github.com/python/black | ||
rev: 23.3.0 | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.4.0 | ||
hooks: | ||
- id: black | ||
- id: check-symlinks | ||
- id: destroyed-symlinks | ||
- id: trailing-whitespace | ||
- id: end-of-file-fixer | ||
- id: check-yaml | ||
- id: check-toml | ||
- id: check-ast | ||
- id: check-added-large-files | ||
- id: check-merge-conflict | ||
- id: check-executables-have-shebangs | ||
- id: check-shebang-scripts-are-executable | ||
- id: detect-private-key | ||
- id: debug-statements | ||
- repo: https://github.com/codespell-project/codespell | ||
rev: v2.2.4 | ||
hooks: | ||
- id: codespell | ||
args: | ||
- --skip=*.css,*.js,*.map,*.scss,*.svg,*.ipynb | ||
- --ignore-words-list=magent | ||
exclude: metaworld/envs/assets_updated/sawyer_xyz/dm_control_pick_place.ipynb | ||
# args: | ||
# - --ignore-words-list== | ||
- repo: https://github.com/PyCQA/flake8 | ||
rev: 6.0.0 | ||
hooks: | ||
- id: flake8 | ||
args: | ||
- '--per-file-ignores=*/__init__.py:F401' | ||
- --extend-ignore=E203,W605,F841,E731,E741,F401 # TODO: fix some of these | ||
- --max-complexity=205 | ||
- --max-line-length=300 | ||
- --ignore=E203,W503,E741 | ||
- --max-complexity=30 | ||
- --max-line-length=456 | ||
- --show-source | ||
- --statistics | ||
- repo: https://github.com/PyCQA/isort | ||
rev: 5.12.0 | ||
hooks: | ||
- id: isort | ||
args: ["--profile", "black"] | ||
- repo: https://github.com/asottile/pyupgrade | ||
rev: v3.3.1 | ||
rev: v3.3.2 | ||
hooks: | ||
- id: pyupgrade | ||
args: ["--py37-plus"] | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.4.0 | ||
args: ["--py38-plus"] | ||
- repo: https://github.com/PyCQA/isort | ||
rev: 5.12.0 | ||
hooks: | ||
- id: mixed-line-ending | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this not used in gymnasium? Seems useful, have had issues with line endings before. Also I feel like we should use the same pre commit config across farama projects similar to farama notifications and the furo documentation stuff. Might go and add these things to pettingzoo. For consistency’s sake. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I believe that this is done in the |
||
args: ["--fix=lf"] | ||
- repo: https://github.com/pycqa/pydocstyle | ||
rev: 6.3.0 | ||
- id: isort | ||
- repo: https://github.com/python/black | ||
rev: 23.3.0 | ||
hooks: | ||
- id: pydocstyle | ||
args: | ||
- --source | ||
- --explain | ||
- --convention=google | ||
- --count | ||
# TODO: Remove ignoring rules D101, D102, D103, D105 | ||
- --add-ignore=D100,D107,D101,D102,D103,D105 | ||
exclude: "__init__.py$|^metaworld.tests|^docs" | ||
additional_dependencies: ["tomli"] | ||
- id: black | ||
# - repo: https://github.com/pycqa/pydocstyle | ||
# rev: 6.3.0 | ||
# hooks: | ||
# - id: pydocstyle | ||
# exclude: ^ | ||
# args: | ||
# - --source | ||
# - --explain | ||
# - --convention=google | ||
# additional_dependencies: ["tomli"] |
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does this do exactly? Should we have doc tests for other projects?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did some googling looks useful, though i don’t think many other farama projects do that style of docs with code examples
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was a copy from Gymnasium where we run this.
I recommend it for having docstrings that are correct and will raise an error if the code changes etc