Skip to content
Pieter-Jan Stas edited this page Sep 21, 2023 · 9 revisions

Requirements

SSH

Dead servers

Tips on debugging pylabnet

There is an option to debug pylabnet with VScode through the launch control window. In Visual Studio, this requires configuring a debugger with a launch.json file that looks like this:

{
    "name": "Python: attach to launcher",
    "type": "python",
    "request": "attach",
    "port": 5678,
    "host": "localhost",
    "redirectOutput" : true,
    "processId": "${command:pickProcess}"
}

Then in the launch control window, click on the debug radio button at the top left of the window:

Screenshot 2023-09-20 at 16 03 38

Then use the dropdown menu to choose whether you want to attach to the launcher or pylabnet_server

Screenshot 2023-09-20 at 16 05 16

and finally launch the script you want to debug. You will see the follow message in the logger:

Screenshot 2023-09-20 at 16 07 30

Then immediately afterwards go to VScode, go to run and debug, choose Python: attach to launcher, search for the process with the appropriate PID in the search bar: Screenshot 2023-09-20 at 16 08 14

Now you can debug your subprocess that was launched via Launch Control! Add breakpoints where you want in VS code.

Updating pylabnet version on PyPI

At any given time, we can freeze the pylabnet source code and publish it to the Python Package Index (PyPI) to be available for public download via pip. The current version on PyPI is available here.

Generally, not every commit or even merge into master needs to be published to pip as a new version. However, if substantial functionality is added that could be useful to other users (especially ones that are not actively developing the platform), it is a good idea to release a new version on pip. In this case, you can do this with the following steps:

  1. Make sure the install_requires kwarg in setup.py is up to date with all mandatory packages. If you have added new dependencies, add them here.

NOTE: The preferred format is to use >= to constrain package versions, rather than ==. Try not to write code that requires a < constraint, since this could cause user-dependent conflicts. As an example of this poor practice, the latest version of Spyder has a conflict with the latest versions of pyqt5.

  1. Update the version number in __init__.py in the root module. We have adopted a 3 digit versioning scheme x.y.z where x is the major version, each new y digit corresponds to a substantially new release (with new software components), and the z digit can increment with any improvements, changes, and bug fixes.

  2. Update CHANGELOG.md

  3. Run the following from the commandline

python setup.py sdist bdist_wheel

This will create a pylabnet/dist directory (which should not be tracked by Github) containing the build files for this version. Note that this requires one to pip install wheel.

  1. To upload to pip, run the command
twine upload dist/*

NOTE: This requires credentials on PyPI, as well as the twine package which can be installed with pip install twine. You may also run into issues if your dist/ folder has older distributions, these should be deleted prior to upload.

Clone this wiki locally