Split up setup.py and move packaging tools to new script
This commit is contained in:
@@ -24,7 +24,7 @@ jobs:
|
||||
run: pip install -r docs/source/requirements.txt
|
||||
|
||||
- name: Build Assets
|
||||
run: python setup.py qtlrelease sample manual
|
||||
run: python pkgutils.py qtlrelease sample manual
|
||||
|
||||
- name: Upload Artifacts
|
||||
uses: actions/upload-artifact@v3
|
||||
@@ -64,7 +64,7 @@ jobs:
|
||||
path: novelwriter/assets
|
||||
|
||||
- name: Build AppImage
|
||||
run: python setup.py build-appimage --linux-tag ${{ matrix.linux-tag }} --python-version ${{ matrix.python-version }}
|
||||
run: python pkgutils.py build-appimage --linux-tag ${{ matrix.linux-tag }} --python-version ${{ matrix.python-version }}
|
||||
|
||||
- name: Upload Artifacts
|
||||
uses: actions/upload-artifact@v3
|
||||
|
||||
@@ -32,7 +32,7 @@ jobs:
|
||||
run: |
|
||||
pip install -U -r requirements.txt -r requirements-dev.txt
|
||||
- name: Run Build Commands
|
||||
run: python setup.py qtlrelease sample
|
||||
run: python pkgutils.py qtlrelease sample
|
||||
- name: Run Tests
|
||||
run: |
|
||||
export QT_QPA_PLATFORM=offscreen
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
include setup.py
|
||||
include pkgutils.py
|
||||
include LICENSE.md
|
||||
include CREDITS.md
|
||||
include CHANGELOG.md
|
||||
|
||||
@@ -18,21 +18,18 @@ to build the various components like the translation files and documentation.
|
||||
``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:
|
||||
in the ``pkgutils.py`` script in the root of the source code. You can list the available commands
|
||||
by running:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
python setup.py help
|
||||
python pkgutils.py help
|
||||
|
||||
.. warning::
|
||||
|
||||
Calling ``setup.py install`` has been deprecated for a while, and this approach is no longer
|
||||
actively supported in novelWriter either.
|
||||
|
||||
In a future version, the packaging and asset build tools part of the current ``setup.py`` file
|
||||
will be moved to another script and the ``setup.py`` file removed entirely.
|
||||
|
||||
|
||||
.. _a_source_depend:
|
||||
|
||||
@@ -116,7 +113,7 @@ You can build the ``.qm`` files with:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
python setup.py qtlrelease
|
||||
python pkgutils.py qtlrelease
|
||||
|
||||
This requires that the Qt Linguist tool is installed on your system. On Ubuntu and Debian, the
|
||||
needed package is called ``qttools5-dev-tools``.
|
||||
@@ -137,7 +134,7 @@ the ``assets`` folder of the source. This file can be built from setup script by
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
python setup.py sample
|
||||
python pkgutils.py sample
|
||||
|
||||
|
||||
.. _a_source_docs:
|
||||
@@ -165,7 +162,7 @@ You can also build a PDF manual from the documentation using the setup script:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
python setup.py manual
|
||||
python pkgutils.py manual
|
||||
|
||||
This will build the documentation as a PDF using LaTeX. The file will then be copied into the
|
||||
assets folder and made available in the :guilabel:`Help` menu in novelWriter. The Sphinx build
|
||||
|
||||
+2
-2
@@ -76,7 +76,7 @@ The `i18n` folder at the root of the repository contains the `nw_XX.ts` translat
|
||||
Whether to add a new language to the translation framework, or to update the file against the
|
||||
current source code, you must first run the `qtlupdate` command:
|
||||
```bash
|
||||
python3 setup.py qtlupdate i18n/nw_XX.ts
|
||||
python3 pkgutils.py qtlupdate i18n/nw_XX.ts
|
||||
```
|
||||
|
||||
The file name must be in the correct format. All translation files must be located in the `i18n`
|
||||
@@ -101,7 +101,7 @@ The application does not use `.ts` files directly. The `novelwriter/assets/i18n/
|
||||
the actual files used to translate the GUI into another language other than the default British
|
||||
English. These files are not generated by default, but they can be built with:
|
||||
```bash
|
||||
python3 setup.py qtlrelease
|
||||
python3 pkgutils.py qtlrelease
|
||||
```
|
||||
|
||||
You can now test the translation in novelWriter. The Preferences dialog should list the newly added
|
||||
|
||||
Executable
+2035
File diff suppressed because it is too large
Load Diff
@@ -1,28 +0,0 @@
|
||||
# Build and Install novelWriter
|
||||
|
||||
The root folder of the repository contains a standard `setup.py` script. The `setup` folder
|
||||
contains necessary files for the setup process, like icons and other files, and it also contains
|
||||
additional scripts that are included in the minimal zip packages.
|
||||
|
||||
## Setup Script
|
||||
|
||||
The `setup.py` script in the root folder has all the necessary commands for generating packages,
|
||||
installing icons, launcher, and file associations on Linux and Windows (no macOS support yet).
|
||||
|
||||
In addition, it is a wrapper for `setuptools` and accept all commands associated with this tool.
|
||||
|
||||
To list all custom package and install options in this script, run:
|
||||
```
|
||||
./setup.py help
|
||||
```
|
||||
## Windows Scripts
|
||||
|
||||
The `windows_install.bat` and `windows_uninstall.bat` are provided as convenience scripts for
|
||||
Windows users who aren't used to running commands from command line. They are both located in the
|
||||
`setup` folder in the source package, but in the minimal zip package for Windows, they can be
|
||||
found in the root folder.
|
||||
|
||||
These scripts are designed to be double-clicked by the user, but can also be run from the command
|
||||
line tool. In either case, they will check if Python is properly installed, and then run the
|
||||
commands to install or uninstall the core dependencies of novelWriter, and then setup or remove the
|
||||
desktop icon, start menu icon and registry entries.
|
||||
@@ -24,13 +24,13 @@ echo "Build Dir: $BUILD_DIR"
|
||||
|
||||
pushd "$SRC_DIR" || exit 1
|
||||
|
||||
VERSION="$(python3 setup.py version)"
|
||||
VERSION="$(python3 pkgutils.py version)"
|
||||
echo "novelWriter Version: $VERSION"
|
||||
|
||||
# --- Prepare Files ----------------------------------------------------------------------------- #
|
||||
|
||||
echo "Generating Info.plist"
|
||||
python3 setup.py gen-plist
|
||||
python3 pkgutils.py gen-plist
|
||||
if [ -f $SRC_DIR/setup/macos/Info.plist ]; then
|
||||
echo "Found: setup/macos/Info.plist"
|
||||
else
|
||||
|
||||
+2
-2
@@ -1,10 +1,10 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
if [ ! -f setup.py ]; then
|
||||
if [ ! -f pkgutils.py ]; then
|
||||
echo "Must be called from the root folder of the source"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
rm -rfv dist_upload
|
||||
python3 setup.py build-clean
|
||||
python3 pkgutils.py build-clean
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
if [ ! -f setup.py ]; then
|
||||
if [ ! -f pkgutils.py ]; then
|
||||
echo "Must be called from the root folder of the source"
|
||||
exit 1
|
||||
fi
|
||||
@@ -10,7 +10,7 @@ echo ""
|
||||
echo " Building Packages"
|
||||
echo "================================================================================"
|
||||
echo ""
|
||||
python3 setup.py qtlrelease manual sample
|
||||
python3 pkgutils.py qtlrelease manual sample
|
||||
python3 -m build
|
||||
mkdir -pv dist_upload
|
||||
cp -v dist/novelWriter-*.whl dist_upload/
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
if [ ! -f setup.py ]; then
|
||||
if [ ! -f pkgutils.py ]; then
|
||||
echo "Must be called from the root folder of the source"
|
||||
exit 1
|
||||
fi
|
||||
@@ -10,20 +10,20 @@ echo ""
|
||||
echo " Building Dependencies"
|
||||
echo "================================================================================"
|
||||
echo ""
|
||||
python3 setup.py clean-assets
|
||||
python3 setup.py qtlrelease manual sample
|
||||
python3 pkgutils.py clean-assets
|
||||
python3 pkgutils.py qtlrelease manual sample
|
||||
|
||||
echo ""
|
||||
echo " Building Minimal Packages"
|
||||
echo "================================================================================"
|
||||
echo ""
|
||||
python3 setup.py minimal-zip --target-win
|
||||
python3 setup.py minimal-zip --target-linux
|
||||
python3 setup.py minimal-zip --target-darwin
|
||||
python3 pkgutils.py minimal-zip --target-win
|
||||
python3 pkgutils.py minimal-zip --target-linux
|
||||
python3 pkgutils.py minimal-zip --target-darwin
|
||||
|
||||
echo ""
|
||||
echo " Building Linux Packages"
|
||||
echo "================================================================================"
|
||||
echo ""
|
||||
python3 setup.py build-deb --sign
|
||||
python3 setup.py build-ubuntu --sign --first
|
||||
python3 pkgutils.py build-deb --sign
|
||||
python3 pkgutils.py build-ubuntu --sign --first
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
if [ ! -f setup.py ]; then
|
||||
if [ ! -f pkgutils.py ]; then
|
||||
echo "Must be called from the root folder of the source"
|
||||
exit 1
|
||||
fi
|
||||
@@ -10,11 +10,11 @@ echo ""
|
||||
echo " Building Dependencies"
|
||||
echo "================================================================================"
|
||||
echo ""
|
||||
python3 setup.py clean-assets
|
||||
python3 setup.py qtlrelease manual sample
|
||||
python3 pkgutils.py clean-assets
|
||||
python3 pkgutils.py qtlrelease manual sample
|
||||
|
||||
echo ""
|
||||
echo " Building Linux Snapshots"
|
||||
echo "================================================================================"
|
||||
echo ""
|
||||
python3 setup.py build-ubuntu --sign --snapshot
|
||||
python3 pkgutils.py build-ubuntu --sign --snapshot
|
||||
|
||||
@@ -7,12 +7,12 @@ python --version 2>NUL
|
||||
if errorlevel 1 goto errorNoPython
|
||||
echo Python found. OK.
|
||||
|
||||
if exist setup.py (
|
||||
echo setup.py found. OK.
|
||||
if exist pkgutils.py (
|
||||
echo pkgutils.py found. OK.
|
||||
) else (
|
||||
cd ..
|
||||
if exist setup.py (
|
||||
echo setup.py found. OK.
|
||||
if exist pkgutils.py (
|
||||
echo pkgutils.py found. OK.
|
||||
) else (
|
||||
goto errorNoSetup
|
||||
)
|
||||
@@ -23,7 +23,7 @@ echo.
|
||||
pip install --user pywin32 -r requirements.txt
|
||||
|
||||
:: Create the desktop and start menu icons
|
||||
python setup.py win-install
|
||||
python pkgutils.py win-install
|
||||
|
||||
pause
|
||||
goto:eof
|
||||
@@ -41,9 +41,9 @@ goto:eof
|
||||
|
||||
:errorNoSetup
|
||||
echo.
|
||||
echo ERROR^: Could not find the setup.py script.
|
||||
echo ERROR^: Could not find the pkgutils.py script.
|
||||
echo.
|
||||
echo Make sure you run setup.py from the novelWriter root folder.
|
||||
echo Make sure you run pkgutils.py from the novelWriter root folder.
|
||||
echo.
|
||||
|
||||
pause
|
||||
|
||||
@@ -7,12 +7,12 @@ python --version 2>NUL
|
||||
if errorlevel 1 goto errorNoPython
|
||||
echo Python found. OK.
|
||||
|
||||
if exist setup.py (
|
||||
echo setup.py found. OK.
|
||||
if exist pkgutils.py (
|
||||
echo pkgutils.py found. OK.
|
||||
) else (
|
||||
cd ..
|
||||
if exist setup.py (
|
||||
echo setup.py found. OK.
|
||||
if exist pkgutils.py (
|
||||
echo pkgutils.py found. OK.
|
||||
) else (
|
||||
goto errorNoSetup
|
||||
)
|
||||
@@ -27,7 +27,7 @@ goto afterUninst
|
||||
:doUninst
|
||||
|
||||
:: Remove the desktop and start menu icons
|
||||
python setup.py win-uninstall
|
||||
python pkgutils.py win-uninstall
|
||||
|
||||
:: Remove the PyQt5 and pyenchant dependencies
|
||||
pip uninstall --yes -r requirements.txt
|
||||
@@ -51,9 +51,9 @@ goto:eof
|
||||
|
||||
:errorNoSetup
|
||||
echo.
|
||||
echo ERROR^: Could not find the setup.py script.
|
||||
echo ERROR^: Could not find the pkgutils.py script.
|
||||
echo.
|
||||
echo Make sure you run setup.py from the novelWriter root folder.
|
||||
echo Make sure you run pkgutils.py from the novelWriter root folder.
|
||||
echo.
|
||||
|
||||
pause
|
||||
|
||||
Reference in New Issue
Block a user