Update documentation on how to install novelWriter from source, and improve build script for pip

This commit is contained in:
Veronica Berglyd Olsen
2023-05-04 23:17:25 +02:00
parent 7a855a3520
commit 18cc8b91dc
2 changed files with 33 additions and 18 deletions
+28 -17
View File
@@ -17,6 +17,14 @@ to build the various components like the translation files and documentation.
now deprecated, but many systems still have both Python 2 and 3. For such systems, the command
``python3`` may be needed instead. Likewise, ``pip`` may need to be replaced with ``pip3``.
Most of the custom commands for building packages of novelWriter, or building assets, are contained
in the ``setup.py`` script in the root of the source code. You can list the available commands by
running:
.. code-block:: bash
python setup.py help
.. _a_source_depend:
@@ -58,37 +66,40 @@ source, dependencies can still be installed from PyPi with:
.. _a_source_install:
Install from Source
===================
Build and Install from Source
=============================
You can download the latest version of novelWriter from the source repository on GitHub_ and run
the setup manually. It is equivalent to what the ``pip install`` command does, and it installs
novelWriter to the default location for Python packages.
This step requires that you have ``setuptools`` installed on your system. If you don't have it
installed, it can usually be installed from your distro's repository. For Debian and Ubuntu this is
achieved with:
If you want to install novelWriter directly from the source available on GitHub_, you must first
build the package using the Python Packaging Authority's build tool. It can be installed with:
.. code-block:: bash
sudo apt install python3-setuptools
pip install --upgrade build
The package is also available from PyPi:
On Debian-based systems the tool can also be installed with:
.. code-block:: bash
pip install --user setuptools
sudo apt install python3-build
With ``setuptools`` in place, novelWriter can be installed to the user space with:
With the tool installed, run the following command from the root of the novelWriter source code:
.. code-block:: bash
python setup.py install --user
python -m build
.. tip::
This should generate two files in the ``dist/`` folder at your current location. One with file
extension ``.tar.gz`` and one with extension ``.whl``. The latter is the package you want to
install, here with example version number 2.0.7, but your may be different:
The main setup script has a number of options that may be useful to you. You can list them by
running ``python setup.py help``.
.. code-block:: bash
pip install --user dist/novelWriter-2.0.7-py3-none-any.whl
.. warning::
Calling ``setup.py install`` has been deprecated for a while, and this approach is no longer
actively supported in novelWriter either.
.. _a_source_i18n:
+5 -1
View File
@@ -11,9 +11,13 @@ echo " Building Packages"
echo "================================================================================"
echo ""
python3 setup.py qtlrelease manual sample
python3 setup.py sdist bdist_wheel
python3 -m build
mkdir -pv dist_upload
cp -v dist/novelWriter-*.whl dist_upload/
cd dist_upload
FILE=$(ls -t | head -1)
shasum -a 256 $FILE | tee $FILE.sha256
cd ..
echo ""
echo " Checking Packages"