Skip to content

Commit

Permalink
Fix doc, lazy-install dependencies & disable PyInstaller for Python 3.10
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuel FORESTIER committed Oct 10, 2020
1 parent 250fb19 commit da73d8f
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 17 deletions.
32 changes: 19 additions & 13 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,53 +10,59 @@ python:
- "pypy3"

install:
# Archey package installation (and dependencies).
# Archey package (and dependencies) install.
- pip3 install .

# Pylint, Stickytape, PyInstaller and PEX external dependencies (see below).
- pip3 install pylint stickytape pyinstaller pex
# Pylint development dependency install.
- pip3 install pylint

script:
# Simple execution.
- time "${VIRTUAL_ENV}/bin/archey"
- time python3 -m archey

# Tests suite.
- python3 setup.py -q test
- python3 -m unittest
- python3 -q setup.py test

# Lint all the things !
- pylint archey/

# Build a standalone script from sources (Stickytape).
- >
pip3 install stickytape && \
stickytape \
--copy-shebang \
--add-python-path . \
--output-file dist/archey \
archey/__main__.py
- chmod +x dist/archey
- time ./dist/archey
archey/__main__.py && \
chmod +x dist/archey && \
time ./dist/archey && \
rm ./dist/archey
# Build a standalone script from sources (PyInstaller).
# Disabled against Python 3.4 (PyInstaller does not support it since 4.0).
# Disabled against Python 3.10 (`lazy-object-proxy` PyInstaller dependency install fails).
# Disabled against PyPy (see <https://stackoverflow.com/a/22245203>).
- >
if ! [[ "$TRAVIS_PYTHON_VERSION" =~ ^(3\.4|pypy3)$ ]]; then
rm ./dist/archey
if ! [[ "$TRAVIS_PYTHON_VERSION" =~ ^(3\.4|3\.10|pypy3)$ ]]; then
pip3 install pyinstaller && \
pyinstaller \
--distpath dist \
--specpath dist \
--name archey \
--onefile archey/__main__.py \
--log-level WARN
time ./dist/archey
--log-level WARN && \
time ./dist/archey && \
rm ./dist/archey
fi
# Build a standalone script from sources (PEX).
- >
pip3 install pex && \
pex \
-o dist/archey \
-m archey \
.
- time ./dist/archey
. && \
time ./dist/archey && \
rm ./dist/archey
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,14 +128,14 @@ mkdir -p ~/.config/archey4
cp archey/config.json ~/.config/archey4/config.json
```

#### Step 4 (optional) : Building & Installing
#### Step 4 (optional) : Standalone building

> Some years ago, Archey was a simple and unique Python file.
> Project evolved, and now it's a proper module.
> Some procedures below walk you through several ways of building Archey as a standalone program.
```bash
# Using StickyTape :
# Using Stickytape :
sudo pip3 install stickytape
stickytape \
--copy-shebang \
Expand Down Expand Up @@ -336,9 +336,11 @@ Here is a short procedure to run them (you'll only need `python3`) :
```bash
git clone https://github.com/HorlogeSkynet/archey4.git
cd archey4/
# If you got `setuptools` installed

# Run the suite from SetupTools.
python3 setup.py test
# But if you don't, no worries !

# Run the suite from the unit testing framework itself.
python3 -m unittest
```

Expand Down

0 comments on commit da73d8f

Please sign in to comment.