Skip to content

Commit

Permalink
Support pip/uv requirements (#120)
Browse files Browse the repository at this point in the history
  • Loading branch information
No767 authored May 17, 2024
1 parent 7018ff8 commit eb567c2
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 19 deletions.
5 changes: 2 additions & 3 deletions docs/dev-guide/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,12 @@ Pull Request Checklist
When you create a pull request, please ensure that the following is done:

1. Ensure that you have forked the repository and created a branch from ``main`` with the correct naming conventions as mentioned :ref:`above <Branch Naming Convention>`.
2. Make sure that you have noted the changes in the ``changelog.md`` file.
3. Your code is properly formatted and linted (and all workflows are passing).
2. Your code is properly formatted and linted (and all workflows are passing).

Git Commit Guidelines
---------------------

1. Use present tense and imperative mood when writing commit messages. For example, ``Add new feature`` instead of ``Added new feature``.
2. Reference issues or pull requests outside of the first line.
a. Please use the shorthand ``#123`` and not the full URL.
3. Commits that need to skip the CI workflows must be prefixed with ``[skip ci]``.
3. Commits that need to skip the CI workflows must be prefixed with ``[skip ci]``.
46 changes: 31 additions & 15 deletions docs/dev-guide/intro.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@ Before you get started, please ensure you have the following installed:

- `Git <https://git-scm.com>`_
- `Python 3 <https://python.org>`_
- `Poetry <https://python-poetry.org>`_
- `Docker <https://docker.com>`_
- Discord Account + App
- Discord Account + `App <https://discordpy.readthedocs.io/en/stable/discord.html>`_

If you are using Linux, the following dependencies will need to be installed:

Expand Down Expand Up @@ -41,35 +40,52 @@ Setup
**Rodhaj only supports Python 3.9 or higher**

.. important::
Ensure that you are in the root of the repo throughout this process
and have the database running
- Ensure that you are in the root of the repo throughout this process and have the database running

- Rodhaj also supports Poetry, but for simplicity, virtualenvs are demonstrated here instead

1. Fork and clone the repo

2. Install dependencies and set up pre-commits
2. Create an virtualenv

.. code-block:: bash
python3 -m venv rodhaj
3. Activate the virtualenv

.. code-block:: bash
# Linux/MacOS
$ source rodhaj/bin/activate
# Windows
$ rodhaj/Scripts/activate.bat
4. Install dependencies and set up pre-commit hooks

.. code-block:: bash
poetry install \
&& poetry run pre-commit install
pip install -r requirements-dev.txt \
&& pre-commit install
3. Copy over the ``config-example.yml`` template over to the ``bot`` directory. Modify the values as appropriate.
5. Copy over the ``config-example.yml`` template over to the ``bot`` directory. Modify the values as appropriate.

.. code-block:: bash
cp config-example.yml bot/config.yml
4. Run the SQL migrations
6. Run the SQL migrations

.. code-block:: bash
poetry run python bot/migrations.py init
python3 bot/migrations.py init
5. In order to demonstrate, you can run the bot to test everything out
7. In order to demonstrate, you can run the bot to test everything out

.. code-block:: bash
poetry run python bot/launcher.py
python3 bot/launcher.py
Database
--------
Expand All @@ -93,11 +109,11 @@ Using Docker
If you decide to use Docker to run the local PostgreSQL server, then a
pre-built Docker Compose file is provided. Setup instructions are as follows:

1. Copy ``envs/docker.env`` to ``docker-compose.env`` within the root of the repo. Modify as appropriate.
1. Copy ``envs/docker.env`` to ``.env`` within the root of the repo. Modify as appropriate.

.. code-block:: bash
cp envs/docker.env docker-compose.env
cp envs/docker.env .env
2. Run the following command to start the PostgreSQL server

Expand All @@ -124,4 +140,4 @@ valuable insight. This exporter can be enabled by setting the
Prometheus client libraries are listed within the
``requirements.txt`` file. By default, these libraries
should be installed, but disabling the exporter will not
affect the usage of these libraries.
affect the usage of these libraries.
2 changes: 1 addition & 1 deletion docs/user-guide/features.rst
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,4 @@ production environments.
.. note::

Disabling this extension will have no effect
on the bot itself.
on the bot itself.
13 changes: 13 additions & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
-r requirements.txt

# Develoment
pre-commit>=3.7.1,<4
pyright>=1.1.363,<2
ruff>=0.4.4,<1
tox>=4.15.0,<5

# Docs
sphinx>=7.3.7,<8
sphinx-autobuild>=2024.4.16,<2025
sphinx-copybutton>=0.5.2,<1
furo>=2024.5.6,<2025

0 comments on commit eb567c2

Please sign in to comment.