diff --git a/changelog.d/3176.changed.md b/changelog.d/3176.changed.md new file mode 100644 index 0000000000..51948389ce --- /dev/null +++ b/changelog.d/3176.changed.md @@ -0,0 +1 @@ +The old-style `setup.py` script was removed and installation docs were updated diff --git a/doc/howto/generic-install-from-source.rst b/doc/howto/generic-install-from-source.rst index 9440358fc3..a18072d27e 100644 --- a/doc/howto/generic-install-from-source.rst +++ b/doc/howto/generic-install-from-source.rst @@ -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 @@ -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: @@ -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/`. diff --git a/doc/howto/manual-install-on-debian.rst b/doc/howto/manual-install-on-debian.rst index 2e849434a7..71358adc20 100644 --- a/doc/howto/manual-install-on-debian.rst +++ b/doc/howto/manual-install-on-debian.rst @@ -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 diff --git a/setup.py b/setup.py deleted file mode 100644 index c6b6bc2c1d..0000000000 --- a/setup.py +++ /dev/null @@ -1,5 +0,0 @@ -from setuptools import setup - -setup( - setup_requires=['setuptools_scm'], -) diff --git a/tools/docker/build.sh b/tools/docker/build.sh index 74cea59df3..d66f33bb37 100755 --- a/tools/docker/build.sh +++ b/tools/docker/build.sh @@ -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