瀏覽代碼

Merge pull request #200 from rodrigodelazcano/github_ci

Github CI
Mark Towers 2 年之前
父節點
當前提交
954fd1ff92

+ 27 - 0
.github/ISSUE_TEMPLATE/bug.md

@@ -0,0 +1,27 @@
+---
+name: Bug Report
+about: Submit a bug report
+title: "[Bug Report] Bug title"
+
+---
+
+If you are submitting a bug report, please fill in the following details and use the tag [bug].
+
+**Describe the bug**
+A clear and concise description of what the bug is.
+
+**Code example**
+Please try to provide a minimal example to reproduce the bug. Error messages and stack traces are also helpful.
+
+**System Info**
+Describe the characteristic of your environment:
+ * Describe how `gym-minigrid` was installed (pip, docker, source, ...)
+ * What OS/version of Linux you're using. Note that while we will accept PRs to improve Window's support, we do not officially support it.
+ * Python version
+
+**Additional context**
+Add any other context about the problem here.
+
+### Checklist
+
+- [ ] I have checked that there is no similar [issue](https://github.com/Farama-Foundation/gym-minigrid/issues) in the repo (**required**)

+ 33 - 0
.github/ISSUE_TEMPLATE/proposal.md

@@ -0,0 +1,33 @@
+---
+name: Proposal
+about: Propose changes that are not fixes bugs
+title: "[Proposal] Proposal title"
+---
+
+
+
+### Proposal 
+
+A clear and concise description of the 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.
+
+### Checklist
+
+- [ ] I have checked that there is no similar [issue](https://github.com/Farama-Foundation/gym-minigrid/issues) in the repo (**required**)

+ 12 - 0
.github/ISSUE_TEMPLATE/question.md

@@ -0,0 +1,12 @@
+---
+name: Question
+about: Ask a question
+title: "[Question] Question title"
+---
+
+
+### Question
+
+If you're a beginner and have basic questions, please ask on [r/reinforcementlearning](https://www.reddit.com/r/reinforcementlearning/) or in the [RL Discord](https://discord.com/invite/xhfNqQv) (if you're new please use the beginners channel). Basic questions that are not bugs or feature requests will be closed without reply, because GitHub issues are not an appropriate venue for these.
+
+Advanced/nontrivial questions, especially in areas where documentation is lacking, are very much welcome.

+ 45 - 0
.github/PULL_REQUEST_TEMPLATE.md

@@ -0,0 +1,45 @@
+# Description
+
+Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
+
+Fixes # (issue)
+
+## Type of change
+
+Please delete options that are not relevant.
+
+- [ ] Bug fix (non-breaking change which fixes an issue)
+- [ ] New feature (non-breaking change which adds functionality)
+- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
+- [ ] This change requires a documentation update
+
+### Screenshots
+Please attach before and after screenshots of the change if applicable.
+
+<!--
+Example:
+
+| Before | After |
+| ------ | ----- |
+| _gif/png before_ | _gif/png after_ |
+
+
+To upload images to a PR -- simply drag and drop an image while in edit mode and it should upload the image directly. You can then paste that source into the above before/after sections.
+-->
+
+# Checklist:
+
+- [ ] I have run the [`pre-commit` checks](https://pre-commit.com/) with `pre-commit run --all-files` (see `CONTRIBUTING.md` instructions to set it up)
+- [ ] I have commented my code, particularly in hard-to-understand areas
+- [ ] I have made corresponding changes to the documentation
+- [ ] My changes generate no new warnings
+- [ ] I have added tests that prove my fix is effective or that my feature works
+- [ ] New and existing unit tests pass locally with my changes
+
+<!--
+As you go through the checklist above, you can mark something as done by putting an x character in it
+
+For example,
+- [x] I have done this task
+- [ ] I have not done this task
+-->

+ 62 - 0
.github/stale.yml

@@ -0,0 +1,62 @@
+# Configuration for probot-stale - https://github.com/probot/stale
+
+# Number of days of inactivity before an Issue or Pull Request becomes stale
+daysUntilStale: 60
+
+# Number of days of inactivity before an Issue or Pull Request with the stale label is closed.
+# Set to false to disable. If disabled, issues still need to be closed manually, but will remain marked as stale.
+daysUntilClose: 14
+
+# Only issues or pull requests with all of these labels are check if stale. Defaults to `[]` (disabled)
+onlyLabels:
+  - more-information-needed
+
+# Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable
+exemptLabels:
+  - pinned
+  - security
+  - "[Status] Maybe Later"
+
+# 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
+
+# Label to use when marking as stale
+staleLabel: stale
+
+# Comment to post when marking 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 removing the stale label.
+# unmarkComment: >
+#   Your comment here.
+
+# Comment to post when closing a stale Issue or Pull Request.
+# closeComment: >
+#   Your comment here.
+
+# Limit the number of actions per hour, from 1-30. Default is 30
+limitPerRun: 30
+
+# Limit to only `issues` or `pulls`
+only: issues
+
+# Optionally, specify configuration settings that are specific to just 'issues' or 'pulls':
+# pulls:
+#   daysUntilStale: 30
+#   markComment: >
+#     This pull request 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.
+
+# issues:
+#   exemptLabels:
+#     - confirmed

+ 19 - 0
.github/workflows/build.yml

@@ -0,0 +1,19 @@
+name: build
+on: [pull_request, push]
+
+jobs:
+  build:
+    runs-on: ubuntu-latest
+    strategy:
+      matrix:
+        python-version: ['3.6', '3.7', '3.8', '3.9', '3.10']
+    steps:
+      - uses: actions/checkout@v2
+      - run: |
+           docker build -f py.Dockerfile \
+             --build-arg PYTHON_VERSION=${{ matrix.python-version }} \
+             --tag gym-minigrid-docker .
+      
+      # TODO: Add and fix tests for pytest
+      # - name: Run tests
+      #   run: docker run gym-docker pytest

+ 17 - 0
.github/workflows/pre-commit.yml

@@ -0,0 +1,17 @@
+# 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]
+jobs:
+  pre-commit:
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v2
+      - uses: actions/setup-python@v2
+      - run: pip install pre-commit
+      - run: pre-commit --version
+      - run: pre-commit install
+      - run: pre-commit run --all-files

+ 15 - 0
.pre-commit-config.yaml

@@ -0,0 +1,15 @@
+# TODO: Add pre-commit hooks
+#         - black []
+#         - codespell [x]
+#         - flake8 [] 
+#         - isort []
+#         - pydocstyle []
+#         - pyupgrade []
+#         - pyright []
+
+---
+repos:
+  - repo: https://github.com/codespell-project/codespell
+    rev: v2.1.0
+    hooks:
+      - id: codespell

+ 0 - 10
.travis.yml

@@ -1,10 +0,0 @@
-language: python
-python:
-  - "3.9"
-
-# command to install dependencies
-install:
-  - pip3 install -e .
-
-# command to run tests
-script: ./run_tests.py

+ 13 - 0
CODE_OF_CONDUCT.rst

@@ -0,0 +1,13 @@
+Farama Foundation is dedicated to providing a harassment-free experience for
+everyone, regardless of gender, gender identity and expression, sexual
+orientation, disability, physical appearance, body size, age, race, or
+religion. We do not tolerate harassment of participants in any form.
+
+This code of conduct applies to all Farama Foundation spaces (including Gist
+comments) both online and off. Anyone who violates this code of
+conduct may be sanctioned or expelled from these spaces at the
+discretion of the Farama Foundation team.
+
+We may add additional rules over time, which will be made clearly
+available to participants. Participants are responsible for knowing
+and abiding by these rules.

+ 5 - 5
README.md

@@ -323,7 +323,7 @@ object at split.
 
 ### Locked room environment
 
-Registed configurations:
+Registered configurations:
 - `MiniGrid-LockedRoom-v0`
 
 The environment has six rooms, one of which is locked. The agent receives
@@ -334,7 +334,7 @@ to solve with vanilla reinforcement learning alone.
 
 ### Key corridor environment
 
-Registed configurations:
+Registered configurations:
 - `MiniGrid-KeyCorridorS3R1-v0`
 - `MiniGrid-KeyCorridorS3R2-v0`
 - `MiniGrid-KeyCorridorS3R3-v0`
@@ -361,7 +361,7 @@ key is placed. This environment can be solved without relying on language.
 
 ### Unlock environment
 
-Registed configurations:
+Registered configurations:
 - `MiniGrid-Unlock-v0`
 
 <p align="center">
@@ -373,7 +373,7 @@ relying on language.
 
 ### Unlock pickup environment
 
-Registed configurations:
+Registered configurations:
 - `MiniGrid-UnlockPickup-v0`
 
 <p align="center">
@@ -385,7 +385,7 @@ locked door. This environment can be solved without relying on language.
 
 ### Blocked unlock pickup environment
 
-Registed configurations:
+Registered configurations:
 - `MiniGrid-BlockedUnlockPickup-v0`
 
 <p align="center">

+ 12 - 0
py.Dockerfile

@@ -0,0 +1,12 @@
+# A Dockerfile that sets up a full Gym install with test dependencies
+ARG PYTHON_VERSION
+FROM python:$PYTHON_VERSION
+
+SHELL ["/bin/bash", "-o", "pipefail", "-c"]
+
+RUN apt-get -y update
+
+COPY . /usr/local/gym_minigrid/
+WORKDIR /usr/local/gym_minigrid/
+
+RUN pip install .[testing] --no-cache-dir

+ 3 - 0
requirements.txt

@@ -0,0 +1,3 @@
+numpy>=1.18.0
+gym>=0.25
+matplotlib>=3.0

+ 24 - 13
setup.py

@@ -11,28 +11,39 @@ with open("README.md") as fh:
         else:
             break
 
+# pytest is pinned to 7.0.1 as this is last version for python 3.6 
+extras = {
+    "testing": ["pytest==7.0.1"]
+}
+
 setup(
-    name='gym_minigrid',
+    name="gym_minigrid",
     author="Farama Foundation",
     author_email="jkterry@farama.org",
-    version='1.0.2',
-    keywords='memory, environment, agent, rl, gym',
-    url='https://github.com/Farama-Foundation/gym-minigrid',
-    description='Minimalistic gridworld reinforcement learning environments',
-    packages=['gym_minigrid', 'gym_minigrid.envs'],
-    long_description=long_description,
-    python_requires=">=3.7, <3.11",
-    long_description_content_type="text/markdown",
-    install_requires=[
-        "numpy>=1.18.0",
-        'gym>=0.25.0'
-    ],
     classifiers=[
         "Development Status :: 5 - Production/Stable",
         "Programming Language :: Python :: 3",
+        "Programming Language :: Python :: 3.6",
         "Programming Language :: Python :: 3.7",
         "Programming Language :: Python :: 3.8",
         "Programming Language :: Python :: 3.9",
         "Programming Language :: Python :: 3.10",
     ],
+    version="1.1.0",
+    keywords="memory, environment, agent, rl, gym",
+    url="https://github.com/Farama-Foundation/gym-minigrid",
+    description="Minimalistic gridworld reinforcement learning environments",
+    extras_require=extras,
+    packages=["gym_minigrid", "gym_minigrid.envs"],
+    license="Apache",
+    long_description=long_description,
+    long_description_content_type="text/markdown",
+    install_requires=[
+        "gym>=0.25.0",
+        "numpy>=1.18.0",
+        "matplotlib>=3.0",
+    ],
+    python_requires=">=3.6",
+    tests_require=extras["testing"],
+    
 )

+ 1 - 0
test_requirements.txt

@@ -0,0 +1 @@
+pytest==7.0.1