Contributing — I hate money 5.0 documentation (2024)

Current direction (as of 2024)

Ihatemoney was started in 2011, and we believe the project has reached a certainlevel of maturity now. The overall energy of contributors is not as high as itused to be.

In addition, there are now several self-hosted alternatives (for instancecospend,spliit).

As maintainers, we believe that the project is still relevant but should geartowards some kind of “maintenance mode”:

  • Simplicity is now the main goal of the project. It has always been a compassfor the project, and the resulting software is appreciated by both users andserver administrators. For us, “simplicity” is positive and encompasses bothtechnical aspects (very few javascript code, manageable dependencies, small codesize…) and user-visible aspects (straightforward interface, no need to createaccounts for people you invite, same web interface on mobile…)

  • Stability is prioritized over adding major new features. We found ourselvescomplexifying the codebase (and the interface) while accepting somecontributions. Our goal now is to have a minimal set of features that do most ofthe job. We believe this will help lower the maintainance burden.

  • User interface and user experience improvements are always super welcome !

It is still possible to propose new features, but they should fit intothis new direction. Simplicity of the UI/UX and simplicity of the technicalimplementation will be the main factors when deciding to accept new features.

How to contribute

You would like to contribute? First, thanks a bunch! This project is asmall project with just a few people behind it, so any help isappreciated!

There are different ways to help us, regarding if you are a designer, adeveloper or an user.

As a developer

If you want to contribute code, you can write it and then issue a pullrequest on github. To get started, please read Set up a dev environment andContributing as a developer.

As a designer / Front-end developer

Feel free to provide mockups, or to involve yourself in the discussionshappening on the GitHub issue tracker. All ideas are welcome. Of course,if you know how to implement them, feel free to fork and make a pullrequest.

As a translator

If you’re able to translate Ihatemoney in your own language, head overto the website we use fortranslationsand start translating.

All the heavy lifting will be done automatically, and your strings willeventually be integrated.

Once a language is ready to be integrated, add it to theSUPPORTED_LANGUAGES list, in ihatemoney/default_settings.py.

End-user

You are using the application and found a bug? You have some ideas abouthow to improve the project? Please tell us by filling a newissue.

Thanks again!

Set up a dev environment

You must develop on top of the Git master branch:

git clone https://github.com/spiral-project/ihatemoney.git

Then you need to build your dev environment. Choose your way…

The quick way

If System installation-requirements arefulfilled, you can just issue:

make serve

It will setup a Virtualenvironment, installdependencies, and run the test server.

The hard way

Alternatively, you can use pip to install dependencies yourself. Thatwould be:

And then run the application:

cd ihatemoneypython run.py

The docker way

If you prefer to use docker, then you can build your image with:

docker build -t ihatemoney .

Accessing dev server

In any case, you can point your browser at http://localhost:5000.It’s as simple as that!

Updating

In case you want to update to newer versions (from Git), you can justrun the “update” command:

make update

Useful settings

It is better to actually turn the debugging mode on when you’redeveloping. You can create a settings.cfg file, with the followingcontent:

DEBUG = TrueSQLACHEMY_ECHO = DEBUG

Then before running the application, declare its path with :

export IHATEMONEY_SETTINGS_FILE_PATH="$(pwd)/settings.cfg"

You can also set the TESTING flag to True so no mails are sent (andno exception is raised) while you’re on development mode.

In some cases, you may need to disable secure cookies by settingSESSION_COOKIE_SECURE to False. This is needed if you access yourdev server over the network: with the default value ofSESSION_COOKIE_SECURE, the browser will refuse to send the sessioncookie over insecure HTTP, so many features of Ihatemoney won’t work(project login, language change, etc).

Contributing as a developer

All code contributions should be submitted as pull requests on thegithub project.

Below are some points that you should check to help you prepare yourpull request.

Running tests

Please, think about updating and running the tests before asking for apull request as it will help us to maintain the code clean and running.

To run the tests:

make test

Tests can be edited in ihatemoney/tests/tests.py. If some test casesfail because of your changes, first check whether your code correctlyhandle these cases. If you are confident that your code is correct andthat the test cases simply need to be updated to match your changes,update the test cases and send them as part of your pull request.

If you are introducing a new feature, you need to either add tests toexisting classes, or add a new class (if your new feature issignificantly different from existing code).

Formatting code

We are using black andisort formatters for all thePython files in this project. Be sure to run it locally on your files.To do so, just run:

make black isort

You can also integrate them with your dev environment (as aformat-on-save hook, for instance).

Creating database migrations

In case you need to modify the database schema, first make sure that youhave an up-to-date database by running the dev server at least once (thequick way or the hard way, see above). The dev server applies allexisting migrations when starting up.

You can now update the models in ihatemoney/models.py. Then run thefollowing command to create a new database revision file:

make create-database-revision

If your changes are simple enough, the generated script will bepopulated with the necessary migrations steps. You can view and edit thegenerated script, which is useful to review that the expected modelchanges have been properly detected. Usually the auto-detection workswell in most cases, but you can of course edit the script to fix smallissues. You could also edit the script to add data migrations.

When you are done with your changes, don’t forget to add the migrationscript to your final git commit!

If the migration script looks completely wrong, remove the script andstart again with an empty database. The simplest way is to remove orrename the dev database located at /tmp/ihatemoney.db, and run the devserver at least once.

For complex migrations, it is recommended to start from an emptyrevision file which can be created with the following command:

make create-empty-database-revision

You then need to write the migration steps yourself.

Repository rules

  • Please, try to keep it to one pull request per feature: if you want to do morethan one thing, send multiple pull requests. It will be easier for us to review andmerge.

  • Document your code: if you add a new feature, please document it in the

  • All the people working on this project do it on their spare time. So please, bepatient if we don’t answer right away.

  • We try to have two maintainers review the pull requests before merging it. So please,be patient if we don’t merge it right away. After one week, only one maintainer approvalis required.

How to build the documentation ?

The documentation is usingsphinx and its source is locatedinside the docsfolder.

Install doc dependencies (within the virtual environment, if any):

pip install -e .[doc]

And to produce a HTML doc in the [docs/_output]{.title-ref} folder:

cd docs/make html

How to release?

Requirements

To create a new release, make sure you fullfil all requirements:

  • Are you a maintainer of the pypi package?

  • Are you sure you have no local tags? They will all be published tothe github process as part of the release process

  • Make sure you have a ~/.pypirc file with the following content,replacing YOUR_PYPI_USERNAME with your real username:

    [distutils]index-servers = pypi[pypi]username:YOUR_PYPI_USERNAME

Choosing a version number

The project follows semantic versioning. To sumthings up:

  • if there is a breaking change since the last release: increasethe major version number (11.X.Y → 12.0.0). Example of breakingchanges: drop support for an old version of python, new settingwithout default value (requires an admin to configure the newsetting), changed URL paths, any other incompatible change. Makesure to document the upgrade process.

  • if there is a significant new feature or a new setting: increasethe minor version number (11.4.Y → 11.5.0). Make sure todocument any new settings.

  • if it’s mostly bugfixes and small changes: increase the patchversion number (11.4.8 → 11.4.9)

Making the release

In order to issue a new release, follow the following steps:

  • Merge remaining pull requests;

  • Switch to the master branch;

  • Update CHANGELOG.md with the last changes;

  • Update CONTRIBUTORS (instructions inside the file);

  • If needed, recompress assets. It requires zopflipng and ImageMagickmogrify:

    make compress-assets
  • Extract the translations:

    make extract-translations
  • If you’re not completely sure of yourself at this point, you canoptionally: create a new branch, push it, open a pull request, checkthe CI result, and then merge the branch to master.

Once this is done, make sure your local git repository is on the masterbranch, and let’s release!:

make release

This will publish the new version to the Python PackageIndex (PyPI) and publish a tag in the git repository.

Note

The above command will prompt for version number, handleCHANGELOG.md and pyproject.toml updates, package creation,pypi upload. It will prompt you before each step to get your consent.

Finally, create a release on Github and copy the relevant changelogextract into it.

Contributing — I hate money 5.0 documentation (2024)

References

Top Articles
Latest Posts
Article information

Author: Melvina Ondricka

Last Updated:

Views: 6183

Rating: 4.8 / 5 (68 voted)

Reviews: 91% of readers found this page helpful

Author information

Name: Melvina Ondricka

Birthday: 2000-12-23

Address: Suite 382 139 Shaniqua Locks, Paulaborough, UT 90498

Phone: +636383657021

Job: Dynamic Government Specialist

Hobby: Kite flying, Watching movies, Knitting, Model building, Reading, Wood carving, Paintball

Introduction: My name is Melvina Ondricka, I am a helpful, fancy, friendly, innocent, outstanding, courageous, thoughtful person who loves writing and wants to share my knowledge and understanding with you.