Skip to content

Commit

Permalink
Merge pull request Uninett#3176 from Uninett/cleanup/remove-setup-py
Browse files Browse the repository at this point in the history
Remove `setup.py` once and for all
  • Loading branch information
lunkwill42 authored Nov 20, 2024
2 parents 5937b2a + 14f0073 commit 27b12b5
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 17 deletions.
1 change: 1 addition & 0 deletions changelog.d/3176.changed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The old-style `setup.py` script was removed and installation docs were updated
35 changes: 25 additions & 10 deletions doc/howto/generic-install-from-source.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,14 @@ To run NAV, these software packages are required:
PostgreSQL and Graphite are services that do not necessarily need to run on
the same server as NAV.

The required Python modules can be installed either from your OS package
manager, or from the Python Package Index (PyPI_) using the regular ``setup.py``
method described below. The packages can also be installed from PyPI_ in a
separate step, using the pip_ tool and the provided requirements and constraints
files::
While the required Python modules can be installed from your OS package
manager, most distributions do not provide all of them, or cannot provide them
in the required versions. We recommend creating a Python virtual environment
(virtualenv), which will ensure NAV's Python requirements do not interfere with
your system Python libraries. Use pip_ to install all Python requirements
from the Python Package Index (PyPI_), using the method described below. The
packages can also be installed from PyPI_ in a separate step, using the pip_
tool and the provided requirements and constraints files::

pip install -r requirements.txt -c constraints.txt

Expand Down Expand Up @@ -90,13 +93,25 @@ the following command to build the CSS assets::
This will build the CSS assets and place them in the :file:`python/nav/web/static/css`
directory.

To build and install NAV and all its Python dependencies::
We recommend installing NAV into a Python virtual environment, to avoid
interfering with your system-wide Python libraries. Pick a suitable path for
the virtual environment (e.g. :file:`/opt/nav`), create it and activate it in
your shell before installing NAV::

python3 -m venv /opt/nav
source /opt/nav/bin/activate

To build and install NAV and all its Python dependencies in the activated
virtual environment, run::

pip install -r requirements.txt -c constraints.txt .

This will build and install NAV in the default system-wide directories for your
system. If you wish to customize the install locations, please consult the
output of ``python setup.py install --help``.
If you want to make sure you can run all NAV programs without first explicitly
activating the virtual environment in a shell, you can add the virtual
environment's :file:`bin` directory to your system's :envvar:`PATH` variable,
e.g.::

export PATH=$PATH:/opt/nav/bin


.. _initializing-the-configuration-files:
Expand Down Expand Up @@ -202,7 +217,7 @@ Building the documentation

If you wish, this HTML documentation can be built separately using this step::

python setup.py build_sphinx
sphinx-build

The resulting files will typically be placed in :file:`build/sphinx/html/`.

Expand Down
2 changes: 1 addition & 1 deletion doc/howto/manual-install-on-debian.rst
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ actually find :file:`nav.conf`::

If you like, you can build the complete HTML documentation thus::

python setup.py build_sphinx
sphinx-build


6. Initialize the database
Expand Down
5 changes: 0 additions & 5 deletions setup.py

This file was deleted.

2 changes: 1 addition & 1 deletion tools/docker/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -ex

if [[ ! -f "/source/setup.py" ]]; then
if [[ ! -f "/source/pyproject.toml" ]]; then
echo NAV source code does not appear to be mounted at /source
exit 1
fi
Expand Down

0 comments on commit 27b12b5

Please sign in to comment.