From a0ff7a210054ef3bd9a0ff3abd1e2e2a05661d9f Mon Sep 17 00:00:00 2001 From: No767 <73260931+No767@users.noreply.github.com> Date: Fri, 17 May 2024 01:47:13 -0700 Subject: [PATCH 1/4] Add requirements dev --- requirements-dev.txt | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 requirements-dev.txt diff --git a/requirements-dev.txt b/requirements-dev.txt new file mode 100644 index 0000000..8c12055 --- /dev/null +++ b/requirements-dev.txt @@ -0,0 +1,11 @@ +-r requirements.txt + +pre-commit>=3.7.1,<4 +pyright>=1.1.363,<2 +ruff>=0.4.4,<1 +tox>=4.15.0,<5 + +sphinx>=7.3.7,<8 +sphinx-autobuild>=2024.4.16,<2025 +sphinx-copybutton>=0.5.2,<1 +furo>=2024.5.6,<2025 From e506456cdd09872c2b4e54d3aeb60b0b14f00220 Mon Sep 17 00:00:00 2001 From: No767 <73260931+No767@users.noreply.github.com> Date: Fri, 17 May 2024 09:36:12 -0700 Subject: [PATCH 2/4] update docs for new stuff --- docs/dev-guide/intro.rst | 41 +++++++++++++++++++++++++++++++--------- requirements-dev.txt | 2 ++ 2 files changed, 34 insertions(+), 9 deletions(-) diff --git a/docs/dev-guide/intro.rst b/docs/dev-guide/intro.rst index f3424ad..aea0aa9 100644 --- a/docs/dev-guide/intro.rst +++ b/docs/dev-guide/intro.rst @@ -44,32 +44,55 @@ Setup Ensure that you are in the root of the repo throughout this process and have the database running +.. note:: + + Rodhaj also supports Poetry, but for simplicity, + using an virtualenv is shown 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 virtualenv + +.. code-block:: bash + + $ source rodhaj/bin/activate + +On Windows, you activate it as shown: + +.. code-block:: powershell + + $ 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 -------- @@ -124,4 +147,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. \ No newline at end of file + affect the usage of these libraries. diff --git a/requirements-dev.txt b/requirements-dev.txt index 8c12055..e20dc0b 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,10 +1,12 @@ -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 From cc8e8c961726576ef070ced0ab0a29b0e4da17ee Mon Sep 17 00:00:00 2001 From: No767 <73260931+No767@users.noreply.github.com> Date: Fri, 17 May 2024 11:39:08 -0700 Subject: [PATCH 3/4] Update docs --- docs/dev-guide/contributing.rst | 5 ++--- docs/dev-guide/intro.rst | 31 ++++++++++++------------------- docs/user-guide/features.rst | 2 +- 3 files changed, 15 insertions(+), 23 deletions(-) diff --git a/docs/dev-guide/contributing.rst b/docs/dev-guide/contributing.rst index 02f269d..43ceffe 100644 --- a/docs/dev-guide/contributing.rst +++ b/docs/dev-guide/contributing.rst @@ -101,8 +101,7 @@ 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 `. -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 --------------------- @@ -110,4 +109,4 @@ 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]``. \ No newline at end of file +3. Commits that need to skip the CI workflows must be prefixed with ``[skip ci]``. diff --git a/docs/dev-guide/intro.rst b/docs/dev-guide/intro.rst index aea0aa9..a667f4b 100644 --- a/docs/dev-guide/intro.rst +++ b/docs/dev-guide/intro.rst @@ -11,9 +11,8 @@ Before you get started, please ensure you have the following installed: - `Git `_ - `Python 3 `_ -- `Poetry `_ - `Docker `_ -- Discord Account + App +- Discord Account + `App `_ If you are using Linux, the following dependencies will need to be installed: @@ -41,13 +40,9 @@ 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 - -.. note:: - - Rodhaj also supports Poetry, but for simplicity, - using an virtualenv is shown instead. + - 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 instead 1. Fork and clone the repo @@ -57,17 +52,15 @@ Setup python3 -m venv rodhaj -3. Activate virtualenv +3. Activate the virtualenv .. code-block:: bash + + # Linux/MacOS + $ source rodhaj/bin/activate - $ source rodhaj/bin/activate - -On Windows, you activate it as shown: - -.. code-block:: powershell - - $ rodhaj\Scripts\activate.bat + # Windows + $ rodhaj/Scripts/activate.bat 4. Install dependencies and set up pre-commit hooks @@ -116,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 diff --git a/docs/user-guide/features.rst b/docs/user-guide/features.rst index d1479fd..1c11a84 100644 --- a/docs/user-guide/features.rst +++ b/docs/user-guide/features.rst @@ -65,4 +65,4 @@ production environments. .. note:: Disabling this extension will have no effect - on the bot itself. \ No newline at end of file + on the bot itself. From a7ee60da0d7bd337ca0b55cc9d03e25fef8c51e2 Mon Sep 17 00:00:00 2001 From: No767 <73260931+No767@users.noreply.github.com> Date: Fri, 17 May 2024 11:44:37 -0700 Subject: [PATCH 4/4] grammar fixes --- docs/dev-guide/intro.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/dev-guide/intro.rst b/docs/dev-guide/intro.rst index a667f4b..5c18cc5 100644 --- a/docs/dev-guide/intro.rst +++ b/docs/dev-guide/intro.rst @@ -42,7 +42,7 @@ Setup .. important:: - 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 instead + - Rodhaj also supports Poetry, but for simplicity, virtualenvs are demonstrated here instead 1. Fork and clone the repo