-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Restructure project around pyproject.toml
- Introduces `pyproject.toml` that contains all the package's configuration - Removes `setup.py` - Removes almost everything from `setup.cfg`. Only wheel config remains, which cannot be moved for now. - Drops support for python 3.7. It's end of life. - Adds tox command `dependencies` to generate requirements files with pinned dependencies based on dependencies specified in `pyproject.toml`. - Tries to remove all version restrictions from dependencies. Some are kept because it would require code changes.
- Loading branch information
Showing
25 changed files
with
1,314 additions
and
333 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
# Contributing | ||
|
||
Contributions are welcome, and they are greatly appreciated! Every little bit | ||
helps, and credit will always be given. | ||
Contributions are welcome, and they are greatly appreciated! Every little bit helps, and credit will always be given. | ||
|
||
You can contribute in many ways: | ||
|
||
|
@@ -15,19 +14,18 @@ If you are reporting a bug, please make sure to fill out the appropriate issue t | |
|
||
### Fix Bugs | ||
|
||
Look through the Repository Issue Tracker for bugs. Anything tagged with "bug" and "help wanted" is open to whoever | ||
Look through the repository issue tracker for bugs. Anything tagged with "bug" and "help wanted" is open to whoever | ||
wants to implement it. | ||
|
||
### Implement Features | ||
|
||
Look through the Repository Issue Tracker for features. Anything tagged with "enhancement" and "help wanted" is open to | ||
Look through the repository issue tracker for features. Anything tagged with "enhancement" and "help wanted" is open to | ||
whoever wants to implement it. | ||
|
||
### Write Documentation | ||
|
||
flatland could always use more documentation, whether as part of the | ||
official flatland docs, in docstrings, or even on the web in blog posts, | ||
articles, and such. A quick reference for writing good docstrings is available | ||
flatland could always use more documentation, whether as part of the official flatland docs, in docstrings, or even on | ||
the web in blog posts, articles, and such. A quick reference for writing good docstrings is available | ||
at [writing-docstrings](https://docs.python-guide.org/writing/documentation/#writing-docstrings). | ||
|
||
### Submit Feedback | ||
|
@@ -50,14 +48,14 @@ Ready to contribute? Here's how to set up `flatland` for local development. | |
git clone [email protected]:flatland-association/flatland-rl.git | ||
``` | ||
|
||
2. Setup a virtual environment using your preferred method (e.g. venv) and activate it. Make sure python 3.7, 3.8 and | ||
3.9 interpreters are available. Note that if you are using an Apple Macbook with an M1 or M2 processor, you need to | ||
use python 3.8 or 3.9. | ||
2. Set up a virtual environment using your preferred method (we suggest the built-in venv) and activate it. Make sure | ||
all the supported python interpreters (3.8, 3.9, 3.10) is available. This is important because you want to run the | ||
test with all supported versions. | ||
|
||
3. Install the software dependencies using pip: | ||
3. Install dependencies required for development using pip: | ||
|
||
```shell | ||
pip install -r requirements_dev.txt | ||
pip install -r requirements-dev.txt | ||
``` | ||
|
||
4. Create a branch for local development: | ||
|
@@ -68,42 +66,47 @@ Ready to contribute? Here's how to set up `flatland` for local development. | |
|
||
Now you can make your changes locally. | ||
|
||
5. When you're done making changes, check that your changes pass the tests. Use tox to run them as it will automatically | ||
test on all supported python versions: | ||
5. When you're done making changes, check that your changes pass the tests. Use `tox` to run them as it will | ||
automatically test on all supported python versions: | ||
```shell | ||
tox | ||
``` | ||
6. Commit your changes and push your branch to Github: | ||
6. Whenever you feel like you completed an iteration of your changes, commit and push them to GitHub: | ||
```shell | ||
git add . | ||
git commit -m "Addresses #<issue-number> Your detailed description of your changes." | ||
git commit | ||
# Your favorite editor will open, allowing you to enter a message that describes your changes. The first line is the | ||
# subject line. Use sentence capitalisation (but don't end with a period) and limit it to 50 characters. It's good | ||
# practice to use imperative mood, e.g. "Add new feature that does X". If you need more space to describe your | ||
# changes (focus on the what and why, less on the how), add an empty line and then continue with the body. Try to | ||
# keep every line at 72 characters. | ||
git push origin name-of-your-bugfix-or-feature | ||
``` | ||
7. Open a pull request on Github targeting the `main` branch. | ||
7. Open a pull request on GitHub targeting the `main` branch. | ||
## Pull Request Guidelines | ||
Before you submit a pull request, check that it meets these guidelines: | ||
1. The pull request should include tests. | ||
2. The code must be formatted (using an IDE like PyCharm can do this for you). | ||
3. If the pull request adds functionality, the docs should be updated. Put your new functionality into a function with a | ||
docstring, and add the feature to the list in README.rst. | ||
4. The pull request should work for Python 3.7, 3.8, 3.9. We force pipelines to be run successfully for pull requests to | ||
be merged. | ||
5. Pull requests must be approved by at least one member of the core team. This is to ensure that the Technical | ||
Guidelines below are respected and that the code is well tested. | ||
1. Include tests to verify correct behaviour. | ||
2. Format the code according to PEP 8 (an IDE like PyCharm can do this for you). | ||
3. Update the docs if you add new functionality. Put your new functionality into a function with a docstring, and add | ||
the feature to the list in `README.md`. | ||
4. Make sure your changes work with Python 3.8, 3.9 and 3.10. We force pipelines to be run successfully for pull | ||
requests to be merged. | ||
5. Get an approval from at least one member of the core team. This is to ensure that | ||
the [Technical Guidelines](#technical-guidelines) are respected and that the code is well tested. | ||
## Technical Guidelines | ||
### Clean Code | ||
Please adhere to the general [Clean Code](https://www.planetgeek.ch/wp-content/uploads/2014/11/Clean-Code-V2.4.pdf) | ||
principles, for instance, we write short and concise functions and use appropriate naming to ensure readability. | ||
principles. For instance, we write short and concise functions and use appropriate naming to ensure readability. | ||
### Naming Conventions | ||
|
@@ -125,7 +128,7 @@ We use the pylint naming conventions: | |
Docstrings should be formatted using [numpydoc](https://numpydoc.readthedocs.io/en/latest/format.html). | ||
### Accessing resources | ||
### Accessing Resources | ||
We use [importlib-resources](https://importlib-resources.readthedocs.io/en/latest/) to read from local files. | ||
|
@@ -155,7 +158,7 @@ renderer.gl.save_image("filename.bmp") | |
## Type Hints | ||
We use Type Hints ([PEP 484](https://www.python.org/dev/peps/pep-0484/)) for better readability and better IDE support: | ||
We use type hints ([PEP 484](https://www.python.org/dev/peps/pep-0484/)) for better readability and better IDE support: | ||
```python | ||
# This is how you declare the type of a variable type in Python 3.6 | ||
|
@@ -172,11 +175,11 @@ else: | |
child = False | ||
``` | ||
To get started with Type Hints, you can have a look at | ||
To get started with type hints, you can have a look at | ||
the [Type Hints Cheat Sheet](https://mypy.readthedocs.io/en/latest/cheat_sheet_py3.html). | ||
Caveat: We discourage the usage of Type Aliases for structured data since its members remain unnamed. Instead, consider | ||
using NamedTuple: | ||
Caveat: We discourage the usage of type aliases for structured data since its members remain unnamed. Instead, consider | ||
using `NamedTuple`: | ||
```python | ||
# Discouraged: Type Alias with unnamed members | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,14 @@ | ||
include AUTHORS.md | ||
include CONTRIBUTING.rst | ||
include changelog.md | ||
include LICENSE | ||
include README.md | ||
|
||
include requirements_dev.txt | ||
include requirements_continuous_integration.txt | ||
|
||
include CONTRIBUTING.md | ||
include CHANGELOG.md | ||
|
||
include requirements.txt | ||
include requirements-dev.txt | ||
|
||
graft flatland/png | ||
graft env_data | ||
|
||
|
||
recursive-include tests * | ||
recursive-exclude * __pycache__ | ||
recursive-exclude * *.py[co] | ||
prune __pycache__ | ||
global-exclude *.py[cod] | ||
|
||
recursive-include docs *.rst *.md conf.py *.jpg *.png *.gif |
Oops, something went wrong.