Update CONTRIBUTING and INSTALL

This commit is contained in:
Mathieu Comandon 2024-01-07 20:33:04 -08:00
parent b3d52d35e5
commit a892d08f63
3 changed files with 27 additions and 52 deletions

View file

@ -1,10 +1,6 @@
Contributing to Lutris Contributing to Lutris
====================== ======================
IMPORTANT!
If you contribute to Lutris on a somewhat regular basis, be sure to add yourself to the AUTHORS file!
Finding features to work on Finding features to work on
--------------------------- ---------------------------
@ -19,11 +15,9 @@ where you can submit bash scripts for various open source games and engines we
do not already have. do not already have.
Another area where users can help is [confirming some Another area where users can help is [confirming some
issues](https://github.com/lutris/lutris/issues?q=is%3Aissue+is%3Aopen+label%3A%22need+help%22) issues](https://github.com/lutris/lutris/issues?q=is%3Aissue+is%3Aopen+label%3A%22can%27t+reproduce%22+)
that can't be reproduced on the developers setup. Other issues, tagged [need that can't be reproduced on the developers setup. Please make sure that you're able to
help](https://github.com/lutris/lutris/issues?q=is%3Aissue+is%3Aopen+label%3A%22need+help%22) reproduce an issue before attempting to fix it.
might be a bit more technical to resolve but you can always have a look and see
if they fit your area of expertise.
Note that Lutris is not a playground or a toy project. One cannot submit new Note that Lutris is not a playground or a toy project. One cannot submit new
features that aren't on the roadmap and submit a pull request for them without features that aren't on the roadmap and submit a pull request for them without
@ -35,15 +29,17 @@ at all times have a valid use case based on an actual game, be very specific
about why you are implementing a feature otherwise it will get rejected. about why you are implementing a feature otherwise it will get rejected.
Avoid adding options in the GUI or introducing new installer directives for Avoid adding options in the GUI or introducing new installer directives for
things that can be automated. Lutris focuses heavily on automation and on doing things that can be automated. Lutris focuses heavily on automation and on doing
the right thing by default. Only introduce new option when absolutely the right thing by default. Only introduce new options when absolutely
necessary. necessary.
Contributors are welcome to suggest architectural changes or better code design Contributors are welcome to suggest architectural changes or better code design
if they feel like the current implementation should be improved but please take if they feel like the current implementation should be improved but please take
note that we're trying to stay as lean as possible. Requests introducing complex note that we're trying to stay as lean as possible. Requests introducing complex
architectural changes for the sake of "modularity", "Unix pureness" or subjective architectural changes for the sake of "modularity", "Unix pureness" or subjective
aspects might not be received warmly. There are no plans for any rewrite in aspects might not be received warmly. There are no current plans for any rewrite in
another language or switching to another toolkit. another language. Once again, make sure to discuss any change with a core developer
before writing a large amount of code. Keeping your pull requests as small as a possible
is the best way to have them reviewed and merged quickly.
Running Lutris from Git Running Lutris from Git
----------------------- -----------------------
@ -63,16 +59,16 @@ new dependencies, check in the package configuration files for new packages to
install. Debian based distros will have their dependencies listed install. Debian based distros will have their dependencies listed
in `debian/control` and RPM based ones in `lutris.spec`. in `debian/control` and RPM based ones in `lutris.spec`.
The PyGOject introspection libraries are not regular python packages and The PyGOject introspection libraries are not regular python packages, for that
it is not possible for pip to install them or use them from a virtualenv. Make reason, using a virtualenv for development is heavily discouraged. Make
sure to always use PyGOject from your distribution's package manager. Also sure to always use PyGOject from your distribution's package manager. Also
install the necessary GObject bindings as described in the INSTALL file. install the necessary GObject bindings as described in the INSTALL file.
Set up your development environment Set up your development environment
----------------------------------- -----------------------------------
To ensure you have the proper dependencies installed run: `make dev` To ensure you have the proper tools installed run `make dev`
This will install all necessary python packages to get you up and running. This will install all necessary python to allow testing and validating your code.
This project includes .editorconfig so you're good to go if you're using any This project includes .editorconfig so you're good to go if you're using any
editor/IDE that supports this. Otherwise make sure to configure your max line editor/IDE that supports this. Otherwise make sure to configure your max line
@ -84,18 +80,13 @@ Formatting your code
To ensure getting your contributions getting merged faster and to avoid other To ensure getting your contributions getting merged faster and to avoid other
developers from going back and fixing your code, please make sure your code developers from going back and fixing your code, please make sure your code
passes style checks by running `make sc` and fixing any reported issues passes style checks by running `make sc` and fixing any reported issues
before submitting your code. This runs a series of tools to apply pep8 coding before submitting your code. This runs a series of tools to apply PEP 8 coding
style conventions, sorting and grouping imports and checking for formatting issues style conventions, sorting and grouping imports and checking for formatting issues
and other code smells. and other code smells.
You can help fix formatting issues or other code smells by having a look at You can help fix formatting issues or other code smells by having a look at
the CodeFactor page: https://www.codefactor.io/repository/github/lutris/lutris the CodeFactor page: https://www.codefactor.io/repository/github/lutris/lutris
When writing docstrings, you should follow the Google style
(See: https://sphinxcontrib-napoleon.readthedocs.io/en/latest/example_google.html)
You should always provide docstrings, otherwise your code wouldn't pass a
Pylint check.
Writing tests Writing tests
------------- -------------
@ -107,29 +98,28 @@ Running tests
------------- -------------
Be sure to test your changes thoroughly, never submit changes without running Be sure to test your changes thoroughly, never submit changes without running
the code. At the very least, run the test suite and check that nothing broke. the code. Also run the test suite and check that nothing broke.
You can run the test suite by typing `make test` in the source directory. You can run the test suite by typing `make test` in the source directory.
In order to run the test, you'll need to install nose2 and flake8:
pip3 install nose2 flake8
QAing your changes QAing your changes
------------------ ------------------
It is very important that any of your changes be tested manually, especially if It is very important that any of your changes be tested manually, especially if
you didn't add unit tests for the patch. Even trivial changes should be tested you didn't add unit tests. Even trivial changes should be tested
as they could potentially introduce breaking changes from a simple oversight. as they could potentially introduce breaking changes from a simple oversight.
Submitting your changes Submitting your changes
----------------------- -----------------------
Make a new git branch based of `master` in most cases, or `next` if you want to Make a new git branch based of `master` in most cases. Send a pull request
target a future release. Send a pull request through GitHub describing what through GitHub describing what issue the patch solves.
issue the patch solves. If the PR is related to and existing bug report, you If the PR is related to and existing bug report, you can add `(Closes #nnnn)`
can add `(Closes #nnn)` or `(Fixes #nnn)` to your PR title or message, where or `(Fixes #nnnn)` to your PR title or message, where `nnnn` is the ticket
`nnn` is the ticket number you're fixing. If you have been fixing your PR with number you're fixing.
several commits, please consider squashing those commits into one with `git
rebase -i`. If you contribute to Lutris on a somewhat regular basis, be sure to add
yourself to the AUTHORS file!
Developer resources Developer resources
------------------- -------------------
@ -141,7 +131,6 @@ project's code base.
* [Python 3 documentation](https://docs.python.org/3/) * [Python 3 documentation](https://docs.python.org/3/)
* [PyGObject documentation](https://pygobject.readthedocs.io/en/latest/) * [PyGObject documentation](https://pygobject.readthedocs.io/en/latest/)
* [Python Gtk 3 tutorial](https://python-gtk-3-tutorial.readthedocs.io/en/latest/objects.html) * [Python Gtk 3 tutorial](https://python-gtk-3-tutorial.readthedocs.io/en/latest/objects.html)
* [Fakegir GObject code completion](https://github.com/strycore/fakegir)
Project structure Project structure
----------------- -----------------

View file

@ -65,23 +65,9 @@ you can run it directly from the source directory::
cd lutris cd lutris
./bin/lutris ./bin/lutris
Alternatively you can install Lutris manually with the help of **virtualenv**.
First, install ``python-virtualenv`` from your distribution's
repositories, along with dependencies listed in Requirements_.
Then, create and activate virtual environment for Lutris::
virtualenv --system-site-packages ~/lutris
source ~/lutris/bin/activate
While in the virtual environment, run the installation script::
python3 setup.py install
Run Lutris Run Lutris
----------- -----------
If you installed Lutris using a package, you can launch the program by typing If you installed Lutris using a package, you can launch the program by typing
``lutris`` at the command line (same applies to virtualenv method, but you need to ``lutris`` at the command line. And if you want to run Lutris from the source tree,
activate the virtual environment first). And if you want to run Lutris without type ``./bin/lutris``
installing it, start ``./bin/lutris`` from within the source directory.

View file

@ -90,7 +90,7 @@ snap:
snapcraft snapcraft
dev: dev:
pip3 install isort flake8 pylint autopep8 pytest mypy mypy-baseline pip3 install isort flake8 pylint autopep8 pytest mypy mypy-baseline nose2
# ============ # ============
# Style checks # Style checks