Help creating a distributable #395
Replies: 3 comments 45 replies
-
Were you able to clone my project and create a distribution of it without any changes? After cloning, change this line to (...)\PyRx>git clone https://github.com/gswifort/PyRx-sample-project.git
Cloning into 'PyRx-sample-project'...
remote: Enumerating objects: 37, done.
remote: Counting objects: 100% (37/37), done.
remote: Compressing objects: 100% (27/27), done.
remote: Total 37 (delta 4), reused 37 (delta 4), pack-reused 0 (from 0)
Receiving objects: 100% (37/37), 239.01 KiB | 4.27 MiB/s, done.
Resolving deltas: 100% (4/4), done.
(...)\PyRx>cd PyRx-sample-project
(...)\PyRx\PyRx-sample-project>python -m venv venv
(...)\PyRx\PyRx-sample-project>venv\Scripts\activate.bat
(venv) (...)\PyRx\PyRx-sample-project>python -V
Python 3.12.4
(venv) (...)\PyRx\PyRx-sample-project>python -m pip install -e .[dev]
Obtaining file:///C:/Users/gswi/Documents/PROGRAMY/PyRx/PyRx-sample-project
Installing build dependencies ... done
Checking if build backend supports build_editable ... done
(...)
Successfully built pyrx-sample-project
Installing collected packages: pywin32, wxpython, typing-extensions, python-dotenv, pyproject_hooks, pygments, pluggy, packaging, iniconfig, debugpy, colorama, annotated-types, typing-inspection, pytest, pydantic-core, build, pydantic, pydantic_settings, cad-pyrx, pyrx-sample-project
Successfully installed annotated-types-0.7.0 build-1.2.2.post1 cad-pyrx-2.2.20.4591 colorama-0.4.6 debugpy-1.8.15 iniconfig-2.1.0 packaging-25.0 pluggy-1.6.0 pydantic-2.11.7 pydantic-core-2.33.2 pydantic_settings-2.10.1 pygments-2.19.2 pyproject_hooks-1.2.0 pyrx-sample-project-0.1.dev5 pytest-8.4.1 python-dotenv-1.1.1 pywin32-311 typing-extensions-4.14.1 typing-inspection-0.4.1 wxpython-4.2.3
[notice] A new release of pip is available: 24.0 -> 25.1.1
[notice] To update, run: python.exe -m pip install --upgrade pip
(venv) (...)\PyRx\PyRx-sample-project>installer\build_setup.py
* Creating isolated environment: venv+pip...
* Installing packages in isolated environment:
- setuptools >= 61.0
- setuptools_scm>=8
* Getting build dependencies for wheel...
running egg_info
writing src\pyrx_sample_project.egg-info\PKG-INFO
writing dependency_links to src\pyrx_sample_project.egg-info\dependency_links.txt
writing requirements to src\pyrx_sample_project.egg-info\requires.txt
writing top-level names to src\pyrx_sample_project.egg-info\top_level.txt
writing manifest file 'src\pyrx_sample_project.egg-info\SOURCES.txt'
* Building wheel...
running bdist_wheel
running build
running build_py
creating build\lib\pyrx_sample_project
copying src\pyrx_sample_project\cmds.py -> build\lib\pyrx_sample_project
copying src\pyrx_sample_project\rect.py -> build\lib\pyrx_sample_project
copying src\pyrx_sample_project\_version.py -> build\lib\pyrx_sample_project
copying src\pyrx_sample_project\__init__.py -> build\lib\pyrx_sample_project
running egg_info
writing src\pyrx_sample_project.egg-info\PKG-INFO
writing dependency_links to src\pyrx_sample_project.egg-info\dependency_links.txt
writing requirements to src\pyrx_sample_project.egg-info\requires.txt
writing top-level names to src\pyrx_sample_project.egg-info\top_level.txt
writing manifest file 'src\pyrx_sample_project.egg-info\SOURCES.txt'
installing to build\bdist.win-amd64\wheel
running install
running install_lib
creating build\bdist.win-amd64\wheel
creating build\bdist.win-amd64\wheel\pyrx_sample_project
copying build\lib\pyrx_sample_project\cmds.py -> build\bdist.win-amd64\wheel\.\pyrx_sample_project
copying build\lib\pyrx_sample_project\rect.py -> build\bdist.win-amd64\wheel\.\pyrx_sample_project
copying build\lib\pyrx_sample_project\_version.py -> build\bdist.win-amd64\wheel\.\pyrx_sample_project
copying build\lib\pyrx_sample_project\__init__.py -> build\bdist.win-amd64\wheel\.\pyrx_sample_project
running install_egg_info
Copying src\pyrx_sample_project.egg-info to build\bdist.win-amd64\wheel\.\pyrx_sample_project-0.1.dev5-py3.12.egg-info
running install_scripts
creating build\bdist.win-amd64\wheel\pyrx_sample_project-0.1.dev5.dist-info\WHEEL
creating 'C:\Users\gswi\Documents\PROGRAMY\PyRx\PyRx-sample-project\installer\build\archive\tmp5oogw8e1\.tmp-zh72vxv6\pyrx_sample_project-0.1.dev5-py3-none-any.whl' and adding 'build\bdist.win-amd64\wheel' to it
adding 'pyrx_sample_project/__init__.py'
adding 'pyrx_sample_project/_version.py'
adding 'pyrx_sample_project/cmds.py'
adding 'pyrx_sample_project/rect.py'
adding 'pyrx_sample_project-0.1.dev5.dist-info/METADATA'
adding 'pyrx_sample_project-0.1.dev5.dist-info/WHEEL'
adding 'pyrx_sample_project-0.1.dev5.dist-info/top_level.txt'
adding 'pyrx_sample_project-0.1.dev5.dist-info/RECORD'
removing build\bdist.win-amd64\wheel
Successfully built pyrx_sample_project-0.1.dev5-py3-none-any.whl
7-Zip (A) 9.20 Copyright (c) 1999-2010 Igor Pavlov 2010-11-18
Scanning
Creating archive ..\archive.7z
Compressing setup.bat
Compressing bootstrap.py
Compressing loader.lsp.template
Compressing pip.ini.template
Compressing pyrx_sample_project-0.1.dev5-py3-none-any.whl
Everything is Ok
(...)\PyRx\PyRx-sample-project\installer\7zSD.sfx
(...)\PyRx\PyRx-sample-project\installer\build\installer.cfg
(...)\PyRx\PyRx-sample-project\installer\build\archive.7z
1 file(s) copied.
Installer built: (...)\PyRx\PyRx-sample-project\installer\dist\setup.exe
(venv) (...)\PyRx\PyRx-sample-project>installer\dist\setup.exe
(venv) (...)\PyRx\PyRx-sample-project> Then I ran zwcad and loaded the file The problem is that our project directory isn't in the Python search path, so
Now you should be able to load the lsp file. @CEXT-Dan, would it be possible to do this in the lsp file so that PYTHONPATH is overwritten only for that session? |
Beta Was this translation helpful? Give feedback.
-
Yes, I see a few bugs.. Everything worked because I tested it on the same computer.. Sorry, I must have been very tired at the time.. 😖 |
Beta Was this translation helpful? Give feedback.
-
Try this too |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
CEXT-Dan pointed me to this PyRx-sample-project for trying to create an installer so that I can share my pyrx commands easily with others on my team.
I have followed through the instructions and have run into some problems once I get to the Distribution step.
The main issue I am running into is when I share the installer to my other computer for testing it says that loader.py is missing and before that I was having issues with the whl file not being found but the location was specified as the project folder, but I was able to fix that by pointing it to the installed directory. I am really having trouble understanding where to go from here cause the instructions say that build_setup.py "Creates and archive" containing those files yet it does not appear to have any code to copy them over.
I have added a line to copy the loader.py file to the archive but now the loader.lsp the next error I get which makes me really concerned that I am doing something massively wrong here cause the ReadMe says the loader.lsp is created both when running build_setup.py and setup.bat so this makes me think that I am really not understanding what is going on.
Thanks in advance for any insight anyone is willing to offer.
@gswifort thank you so much for making this sample project it was really enlightening.
Beta Was this translation helpful? Give feedback.
All reactions