This project runs on python>=3.8,<3.13
We use PDM as a dependency manager. Check the updated installation instructions from here, or follow these steps:
Linux/MAC:
# Install PDM Linux/MAC
curl -sSL https://pdm-project.org/install-pdm.py | python3 -
Windows:
# Install PDM Windows
(Invoke-WebRequest -Uri https://pdm-project.org/install-pdm.py -UseBasicParsing).Content | python -
Add PATH to environment manager and then run the appropriate command to install all the dependencies based on your Python version and operating system:
Linux:
pdm install --lockfile=pdm-py38unix.lock
Windows:
pdm install --lockfile=pdm-py38win.lock
macOS:
If you are using macOS with Python 3.8, you need to manually install the vtk
package due to compatibility issues. You can do this by running the following command:
pip install https://files.pythonhosted.org/packages/b3/15/40f8264f1b5379f12caf0e5153006a61c1f808937877c996e907610e8f23/vtk-9.3.1-cp38-cp38-macosx_10_10_x86_64.whl
```shell
pdm install --lockfile=pdm-py38macos.lock
Linux:
pdm install --lockfile=pdm-py39+unix.lock
Windows:
pdm install --lockfile=pdm-py39+win.lock
macOS:
pdm install --lockfile=pdm-py39+macos.lock
The corresponding requirements.txt
files are generated during pre-commit hooks and located in the /requirements
folder.
When adding a new package, make sure to update the correct lock file(s). For example:
For Python 3.8 Windows
pdm add <package_name> --lockfile=pdm-py38win.lock
For Python 3.8 Linux
pdm add <package_name> --lockfile=pdm-py38unix.lock
For Python 3.8 (macOS):
pdm add <package_name> --lockfile=pdm-py38macos.lock
For Python 3.9+ Linux
pdm add <package_name> --lockfile=pdm-py39+unix.lock
For Python 3.9+ (macOS):
pdm add <package_name> --lockfile=pdm-py39+macos.lock
Remember to update all relevant lock files when adding or updating dependencies.
If you need to regenerate the lock file, you can use the following command:
# Example for macos and Python 3.8
pdm lock --python="==3.8.*" --platform=macos --with pyvista --with openpyxl --lockfile=pdm-py38macos.lock
# Example for Windows and Python 3.9+
pdm lock --python="==3.8.*" --platform=windows --with pyvista --with openpyxl --lockfile=pdm-py39+win.lock
# Example for Linux and Python 3.9+
pdm lock --python="==3.8.*" --platform=linux --with pyvista --with openpyxl --lockfile=pdm-py39+unix.lock
pdm run pre-commit install --hook-type pre-commit --hook-type pre-push
Linux/MAC:
pdm run src/pyoma2/main.py
To update the lock files for different platforms and Python versions, use the following commands:
For Python 3.8 (Linux/Windows):
pdm lock --python="3.8" --lockfile=pdm-py38.lock
For Python 3.8 (macOS):
pdm lock --python="3.8" --platform=macos --lockfile=pdm-py38macos.lock
For Python 3.9+ (Linux/Windows):
pdm lock --python=">=3.9" --lockfile=pdm-py39+.lock
For Python 3.9+ (macOS):
pdm lock --python=">=3.9" --platform=macos --lockfile=pdm-py39+macos.lock
Make sure to update all relevant lock files when making changes to the project dependencies.
Windows
pdm run .\src\pyoma2\main.py
You'll probably need to install tk for the GUI on your system, here some instructions:
Windows:
https://www.pythonguis.com/installation/install-tkinter-windows/
Linux:
https://www.pythonguis.com/installation/install-tkinter-linux/
Mac:
https://www.pythonguis.com/installation/install-tkinter-mac/
If using python with pyenv
:
https://dev.to/xshapira/using-tkinter-with-pyenv-a-simple-two-step-guide-hh5
Due to NEP 29, Numpy drops support for active versions of Python before their support ends. Therefore, there are versions of numpy that cannot be installed for certain active versions of Python and this leads to PDM unable to resolve the dependencies, or attempting to install a version of numpy that does not have a wheel.
By following Lock for specific platforms or Python versions, you can generate a single lock file for multiple versions of Python with:
pdm lock --python=">=3.9" --with pyvista --with openpyxl
pdm lock --python="==3.8.*" --with pyvista --with openpyxl
When bumping the minimum supported version of Python in pyproject
(requires-python
), be sure to also bump the conditional numpy versions supported. For example, when Python 3.8 is dropped, you will have to modify:
"numpy<1.25; python_version < '3.9'",
"numpy>=1.25; python_version >= '3.9'",
to (this is just a guess; numpy versions will have to change):
"numpy<2.0; python_version < '3.10'",
"numpy>=2.0; python_version >= '3.10'",
make test
make test-coverage
make tox
Use conventional commits guidelines https://www.conventionalcommits.org/en/v1.0.0/