Skip to content

Commit

Permalink
Improve developer installation, remove pip_install_strictdoc_deps.py
Browse files Browse the repository at this point in the history
pip_install_strictdoc_deps.py requires a manual pip install of the toml
module before it works with a fresh virtual environment. We can achieve
a working installation much easier with a virtual environment (which is
better practice anyway) and pip. This begs the question of whether this
script is needed at all. Delete it, and make the corresponding updates
to the Dev Guide and tox.ini.

Update invocations of pip_install_strictdoc_deps.py
  • Loading branch information
Nathaniel Jones committed Jan 17, 2025
1 parent 59961fd commit f381789
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 119 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-windows-powershell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
- name: "Windows specific: Install StrictDoc's dependencies"
run: |
python developer/pip_install_strictdoc_deps.py
pip install .
- name: "Windows specific: Install Check dependencies (everything for lint + test)"
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
- name: "Windows specific: Install StrictDoc's dependencies"
run: |
python developer/pip_install_strictdoc_deps.py
pip install .
- name: "Windows specific: Install Check dependencies (everything for lint + test)"
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/end2end-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ jobs:
- name: "Windows specific: Install StrictDoc's dependencies"
run: |
python developer/pip_install_strictdoc_deps.py
pip install .
- name: "Windows specific: Install Check dependencies (everything for test)"
run: |
Expand Down
101 changes: 0 additions & 101 deletions developer/pip_install_strictdoc_deps.py

This file was deleted.

2 changes: 1 addition & 1 deletion docs/sphinx/source/strictdoc_11_developer_guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ in StrictDoc's source code. Otherwise, install StrictDoc as a normal Pip package
.. code-block::
git clone https://github.com/strictdoc-project/strictdoc.git && cd strictdoc
python developer/pip_install_strictdoc_deps.py
pip install .
python3 strictdoc/cli/main.py
The ``pip_install_strictdoc_deps.py`` installs all dependencies of StrictDoc, but not StrictDoc itself.
Expand Down
27 changes: 18 additions & 9 deletions docs/strictdoc_11_developer_guide.sdoc
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,6 @@ On Linux Ubuntu:
.. code:: bash

sudo apt install tidy

From the core Python packages, StrictDoc needs Invoke, Tox and TOML:

.. code:: bash

pip install invoke tox toml
<<<

[SECTION]
Expand Down Expand Up @@ -89,13 +83,28 @@ STATEMENT: >>>
**Note:** Use this way of installing StrictDoc only if you want to make changes
in StrictDoc's source code. Otherwise, install StrictDoc as a normal Pip package by running ``pip install strictdoc``.

.. code-block::
1. Clone the project.
2. Create a virtual environment.
3. Install dependencies.
4. Run the StrictDoc CLI.

.. code:: bash

git clone https://github.com/strictdoc-project/strictdoc.git && cd strictdoc
python developer/pip_install_strictdoc_deps.py
python3 -m venv .venv
. ./.venv/bin/activate
pip install .
python3 strictdoc/cli/main.py

The ``pip_install_strictdoc_deps.py`` installs all dependencies of StrictDoc, but not StrictDoc itself.
**Note:** Windows users, substitute: ``.\.venv\Scripts\activate``

This installs all dependencies of StrictDoc, but not StrictDoc itself.

To also install the dev dependencies specified in ``pyproject.toml``:

.. code:: bash

pip install ".[development]"
<<<

[/SECTION]
Expand Down
10 changes: 5 additions & 5 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ deps =
# Reload files when changed (used by 'invoke watch')
watchdog>=2.1.7
commands =
python developer/pip_install_strictdoc_deps.py
pip install .
{posargs}

[testenv:{py37,py38,py39,py310,py311,py312}-check]
Expand All @@ -31,7 +31,7 @@ pass_env=
CHROMEWEBDRIVER
STRICTDOC_CACHE_DIR
commands =
python developer/pip_install_strictdoc_deps.py
pip install .
{posargs}

[testenv:{py37,py38,py39,py310,py311,py312}-documentation]
Expand All @@ -48,7 +48,7 @@ deps =
sphinx>=3.2.1
guzzle_sphinx_theme~=0.7.11
commands =
python developer/pip_install_strictdoc_deps.py
pip install .
{posargs}

[testenv:{py37,py38,py39,py310,py311,py312}-release]
Expand All @@ -74,7 +74,7 @@ deps =
twine
{[testenv:py37-check]deps}
commands =
python developer/pip_install_strictdoc_deps.py
pip install .
{posargs}

[testenv:{py37,py38,py39,py310,py311,py312}-pyinstaller]
Expand All @@ -84,5 +84,5 @@ deps =
-rrequirements.bootstrap.txt
pyinstaller
commands =
python developer/pip_install_strictdoc_deps.py
pip install .
{posargs}

0 comments on commit f381789

Please sign in to comment.