pyinstaller but keeping .py files upgradeable

  • Last Update :
  • Techknowledgy :

I've not tried this myself (I use pyInstaller at work but don't have it set up on my home PC) but this is the sort of thing I think should be ok:

a = Analysis(['main.py'])
excluded = ['myfile0.py', 'myfile1.py', 'myfile2.py']
a.scripts = [script from script in a.scripts
   if script not in excluded
]
pyz = PYZ(a.pure)
exe = EXE(a.scripts, pyz, name = "main.exe", exclude_binaries = 1)
dist = COLLECT(exe, a.binaries, excluded, name = "dist")

Actually it's more like this :

a = Analysis(['main.py'])
excluded = ['pathto\\myfile0.py', 'pathto\\myfile1.py', 'pathto\\myfile2.py']
a.scripts = [script from script in a.scripts
   if script[1] not in excluded
]
pyz = PYZ(a.pure)
excluded_files_collect = [(f.split('\\')[-1], f, 'DATA') for f in excluded]
exe = EXE(a.scripts, pyz, name = "main.exe", exclude_binaries = 1)
dist = COLLECT(exe, a.binaries, excluded_files_collect, name = "dist")

As script is actually a tuple with the form :

('myfile0.py', 'pathto\\myfile0.py', 'PYSOURCE')

Suggestion : 2

Second, some runtime hooks are provided. At the end of an analysis, the names in the module list produced by the Analysis phase are looked up in loader/rthooks.dat in the PyInstaller install folder. This text file is the string representation of a Python dictionary. The key is the module name, and the value is a list of hook-script pathnames. If there is a match, those scripts are included in the bundled app and will be called before your main script starts.,If Analysis recognizes that a module is needed, but cannot find that module, it is often because the script is manipulating sys.path. The easiest thing to do in this case is to use the --paths option to list all the other places that the script might be searching for imports:,These files are very large because even the simplest “hello world” Python program ends up including a large number of standard modules. For this reason the graph file is not very useful in this release.,When the Analysis step runs, it produces error and warning messages. These display after the command line if the --log-level option allows it. Analysis also puts messages in a warnings file named build/name/warn-name.txt in the work-path= directory.

. / hello: error
while loading shared libraries: libz.so .1:
   failed to map segment from shared object: Operation not permitted
export TMPDIR = /var/tmp /
pyi - makespec--paths = /path/to / thisdir\
   --paths = /path/to / otherdir myscript.py
import django.core.management
def _find_commands(_):
   return ""
"cleanup shell runfcgi runserver"
"".split()
django.core.management.find_commands = _find_commands
pip install https: //github.com/pyinstaller/pyinstaller/archive/develop.zip

Suggestion : 3

Using your favorite text editor or IDE, create and save new text file with the name Jenkinsfile at the root of your local simple-python-pyinstaller-app Git repository., Using your favorite text editor or IDE, create and save new text file with the name Jenkinsfile at the root of your local simple-python-pyinstaller-app Git repository. ,Save your edited Jenkinsfile and commit it to your local simple-python-pyinstaller-app Git repository. E.g. Within the simple-python-pyinstaller-app directory, run the commands: git add . then git commit -m "Add initial Jenkinsfile", Save your edited Jenkinsfile and commit it to your local simple-python-pyinstaller-app Git repository. E.g. Within the simple-python-pyinstaller-app directory, run the commands: git add . then git commit -m "Add initial Jenkinsfile"

docker network create jenkins
docker run\
--name jenkins - docker\(1)
   --rm\(2)
   --detach\(3)
   --privileged\(4)
   --network jenkins\(5)
   --network - alias docker\(6)
   --env DOCKER_TLS_CERTDIR = /certs \(7)
   --volume jenkins - docker - certs: /certs/client\(8)
   --volume jenkins - data: /var/jenkins_home\(9)
   --publish 2376: 2376\(10)
   --publish 3000: 3000\(11)
docker: dind\(12)
   --storage - driver overlay2(13)
docker run--name jenkins - docker--rm--detach\
   --privileged--network jenkins--network - alias docker\
   --env DOCKER_TLS_CERTDIR = /certs \
   --volume jenkins - docker - certs: /certs/client\
   --volume jenkins - data: /var/jenkins_home\
   --publish 3000: 3000--publish 2376: 2376\
docker: dind--storage - driver overlay2
FROM jenkins / jenkins: 2.346 .2 - jdk11
USER root
RUN apt - get update && apt - get install - y lsb - release
RUN curl - fsSLo / usr / share / keyrings / docker - archive - keyring.asc\
https: //download.docker.com/linux/debian/gpg
   RUN echo "deb [arch=$(dpkg --print-architecture) \
  signed-by=/usr/share/keyrings/docker-archive-keyring.asc] \
  https://download.docker.com/linux/debian \
  $(lsb_release -cs) stable" > /etc/apt / sources.list.d / docker.list
RUN apt - get update && apt - get install - y docker - ce - cli
USER jenkins
RUN jenkins - plugin - cli--plugins "blueocean:1.25.6 docker-workflow:1.29"
docker build - t myjenkins - blueocean: 2.346 .2 - 1 .
docker run\
--name jenkins - blueocean\(1)
   --detach\(2)
   --network jenkins\(3)
   --env DOCKER_HOST = tcp: //docker:2376 \(4)
   --env DOCKER_CERT_PATH = /certs/client\
   --env DOCKER_TLS_VERIFY = 1\
   --publish 8080: 8080\(5)
   --publish 50000: 50000\(6)
   --volume jenkins - data: /var/jenkins_home\(7)
   --volume jenkins - docker - certs: /certs/client: ro\(8)
   --volume "$HOME": /home \(9)
   --restart = on - failure\(10)
   --env JAVA_OPTS = "-Dhudson.plugins.git.GitSCM.ALLOW_LOCAL_CHECKOUT=true"\(11)
myjenkins - blueocean: 2.346 .2 - 1(12)