Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Python 3.12 Compatibility #22

Open
NickLavrov opened this issue Aug 21, 2024 · 1 comment
Open

Add Python 3.12 Compatibility #22

NickLavrov opened this issue Aug 21, 2024 · 1 comment

Comments

@NickLavrov
Copy link

NickLavrov commented Aug 21, 2024

In setup.py in CLASSIFIERS please specify that python 3.12 is supported (if so). Given that there are no external package dependencies, there is nothing to update dependency-wise.

There is no test suite included in this repo, but I did this: Plug in LabJack T7 PRO via ethernet to my M1 Mac and run:
find Examples/Basic -name "*.py" | xargs -I {} python {} 2 (the 2 is for the loop counter argument in labjack-ljm-python/Examples/Basic/write_read_loop_with_config.py so it doesn't loop infinitely). All files ran successfully with python 3.12, with the package installed as pip install -e .. I did not run all the tests in Examples/More because I don't use the other connection methods or advanced aspects of this package.

Looking at how python 3.11 compatibility was added with no changes, I suspect this to not require many changes. One thing is setuptools: (from AI) The setuptools package is still available in Python 3.12 and provides the distutils module, which was deprecated in Python 3.10 and removed in Python 3.12. However, distutils is no longer available by default in virtual environments created with venv. To access it, you can run pip install setuptools in the activated virtual environment. (end of AI). This means that whatever build and release process is used here, if using a venv, will need to install setuptools, likely.

@davelopez01
Copy link
Contributor

Thank you for letting us know about this. We will add Python 3.12 to CLASSIFIERS in our next release. Doing quick tests, the latest labjack-ljm package on PyPi installs with 3.12 fine, and examples seem fine. We will test with 3.12 more thoroughly when we update.

The older method of installing with local files:

python setup.py install

Cannot find setuptools by default in 3.12, but the current recommended way (run in the package's root directory):

python -m pip install .

Will install the setuptools dependency for the installation. Also, "python -m build" will install the setuptools dependency during the build.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants