Skip to content

Commit b41711c

Browse files
committed
fix: typo that prevented pyinstaller builds + update pyInstaller instructions (working now) + update TODO.md
Signed-off-by: Stephen L. <LRQ3000@gmail.com>
1 parent 209507a commit b41711c

File tree

3 files changed

+13
-12
lines changed

3 files changed

+13
-12
lines changed

TODO.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# TODO
22

3-
* pyInstaller
4-
* add screenshot in README
5-
* https://github.com/seanbreckenridge/browserexport or https://github.com/browser-history/browser-history
3+
* [x] pyInstaller
4+
* [x] add screenshot in README
5+
* [x] https://github.com/seanbreckenridge/browserexport or https://github.com/browser-history/browser-history
6+
* [ ] add some text in figure to explain what it is for neophytes and how to read it
7+
* [ ] add autodetection of most common sleep patterns / circadian rhythm disorders patterns (DSPD/night shift work, non-24, ASPD, eveving owl, morning lark, social jet lag). Difference between night shift work and DSPD: night shift work don't sleep as well or as long as DSPD during the day, because not their circadian phase.

pyInstallerInstructions.txt

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,20 @@ Instructions to build a standalone exe using pyInstaller:
22

33
1. Install Anaconda or Miniconda3.
44
2. Launch the Anaconda/Miniconda3 command prompt, or just a standard terminal if conda is in the PATH.
5-
3. conda create -n webactogramenv python=3.10
6-
Note: you can change the python version when a newer interpreter will be released. Creating a new venv is necessary to limit the number of packages in the environment, so that pyinstaller does not include a whole lot of unnecessary packages.
5+
3. conda create -n webactogramenv python=3.11
6+
Note: you can change the python version when a newer interpreter will be released. Creating a new venv is necessary to limit the number of packages in the environment, so that pyinstaller does not include a whole lot of unnecessary packages in the final binaries.
77
4. conda activate webactogramenv
88
5. pip install --upgrade webactogram
99
Note: webactogram needs to be up-to-date on pypi, otherwise replace this command by `pip install -e .` to use the local version.
1010
Note2: if trying to compile for another platform such as 32-bits, then it may be better to install from local machine instead of from pypi, which can be done with: `pip.exe install -e .` without the ticks.
1111
6. pip install --upgrade pyinstaller
1212

1313
From this step on, you can reuse the same environment each time you want to rebuild the freezed binary (as long as you install nothing else but the strictly necessary packages to run your project, as to keep it clean and with minimal dependencies):
14-
7. cd to the webactogram subfolder (the module one, where webactogram.py resides)
14+
7. cd to the webactogram folder (the root of the project, where there is pyproject.toml)
1515
8. conda activate webactogramenv
16-
9. if there is any dist or build or __pycache folder, delete them
17-
10. pyinstaller -D -c --hidden-import="pkg_resources.py2_warn" --hidden-import="pkg_resources.py3_warn" --add-data="_version.py;." webactogram.py
18-
Note: we used to bundle as one-file (with -F option), but in newer versions, the python app is unpackaged in a random temporary folder, which makes it difficult to bundle config files that are easily accessible and modifiable by the user. And also such apps are slower to launch than one-folder bundles. So we now bundle as a one-folder, using the -D option. We also force the console to stay open with the -c argument as it gives additional infos to the user, especially in case of errors.
19-
11. Copy config.ini and config_internal.ini in the dist/webactogram folder
20-
12. Zip the dist/webactogram folder and distribute it.
16+
9. if there is any dist or build or __pycache__ folder (in src/webactogram/__pycache__), delete them
17+
10. pyinstaller -F -c --hidden-import="pkg_resources.py2_warn" --hidden-import="pkg_resources.py3_warn" src/webactogram/webactogram.py
18+
Note: we used to bundle as one-file (with -F option), but in newer versions, the python app is unpackaged in a random temporary folder, which makes it difficult to bundle config files that are easily accessible and modifiable by the user. And also such apps are slower to launch than one-folder bundles. So it can be preferred to bundle as a one-folder app, using the -D option. We also force the console to stay open with the -c argument as it gives additional infos to the user, especially in case of errors.
19+
11. Zip the dist/webactogram folder and distribute it.
2120

2221
To build a 32-bit binary, simply install Miniconda3 32-bit and repeat the steps above with the 32-bit interpreter.

src/webactogram/webactogram.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -788,7 +788,7 @@ def main(argv: Sequence[str] | None = None) -> int:
788788
""" Main entry point for the command line interface """
789789
if argv is None: # if argv is empty, fetch from the commandline
790790
argv = sys.argv[1:]
791-
elif isinstance(argv, _str): # else if argv is supplied but it's a simple string, we need to parse it to a list of arguments before handing to argparse or any other argument parser
791+
elif isinstance(argv, str): # else if argv is supplied but it's a simple string, we need to parse it to a list of arguments before handing to argparse or any other argument parser
792792
argv = shlex.split(argv) # Parse string just like argv using shlex
793793

794794
desc = '''WebActogram

0 commit comments

Comments
 (0)