dictation-toolbox / natlink

Natlink provides the interface between Dragon and python
https://dictation-toolbox.github.io/natlink/
Other
25 stars 17 forks source link

Build/Installer now uses a wheel #133

Closed dougransom closed 2 years ago

dougransom commented 2 years ago

The build process added a step to build a python package for natlink. This allows for python and various python programs to know which natlink is installed, and for natlinkcore (for example) to have a requirements on natlink versions to avoid potential incompatibles. It also opens up possibilities for easier upgrades for developers of natlink or end users.

For example, you can now see natlink installed with pip.

Powershell: `PS C:\Program Files (x86)\Natlink\dist> pip list | Select-String natlink

natlink 5.3.2 natlinkcore 5.2.1`

Python:

`>>> import importlib.metadata as m

m.version('natlink') '5.3.2'`

m.files('natlink') [PackagePath('natlink-5.3.2.dist-info/INSTALLER'), PackagePath('natlink-5.3.2.dist-info/METADATA'), PackagePath('natlink-5.3.2.dist-info/RECORD'), PackagePath('natlink-5.3.2.dist-info/REQUESTED'), PackagePath('natlink-5.3.2.dist-info/WHEEL'), PackagePath('natlink-5.3.2.dist-info/direct_url.json'), PackagePath('natlink/init.py'), PackagePath('natlink/pycache/init.cpython-39.pyc'), PackagePath('natlink/_natlink_core.pyi'), PackagePath('natlink/_natlink_core13.pdb'), PackagePath('natlink/_natlink_core13.pyd'), PackagePath('natlink/_natlink_core15.pdb'), PackagePath('natlink/_natlink_core15.pyd'), PackagePath('natlink/python39.dll')]

https://docs.python.org/3/library/importlib.metadata.html

The python files are still installed in C:\Program Files (x86)\Natlink\site-packages

The python3.x dll is now copied out of the required python during the build, so we are sure to get the one that matches the pyd files.

dougransom commented 2 years ago

Addresses

https://github.com/dictation-toolbox/natlink/issues/127 https://github.com/dictation-toolbox/natlink/issues/125

dougransom commented 2 years ago

please squash when accepting the PR

LexiconCode commented 2 years ago

It'll be three or four days before I can get to this. I've been looking over the code but haven't had to build and run.