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

Installation does not proceed as explained in the documentation #1

Open
domna opened this issue Mar 4, 2025 · 3 comments
Open

Installation does not proceed as explained in the documentation #1

domna opened this issue Mar 4, 2025 · 3 comments
Assignees

Comments

@domna
Copy link

domna commented Mar 4, 2025

When I follow the install instructions in the README the software is not able to run on my system. I had to do this additional steps to actual get the gui:

  1. Do a pip install -r QuDAP/requirements.txt (because python tries to import PySide in instructions.py before the os call for pip install is run)
  2. cd into the QuDAP directory
  3. I needed to manually install pyvisa-py
  4. Change the version check to version == "11" here
    if version == "10" and build_number >= 22000:

While I could mediate these issues which can easily be fixed, I additionally think that the dependency management should be handled differently.

  1. pip install should not be called on every start, because this could impact the software functionality in unforseen ways when packages are updated/changed. This would not be transparent to the user. Additonally, it is an unecesarry start overhead.
  2. The list of dependencies should be specified in pyproject.toml
  3. There should be a frozen list of dependencies to reproduce the dev environment. This can be generated with, e.g., pip-compile or uv. Maybe the hatchling build system has something similar, however, I'm not experienced with it so I can only recommend the other tools.
@domna
Copy link
Author

domna commented Mar 4, 2025

One additional remark to the classifiers. I think this line

"Operating System :: OS Independent",

should state that the software is build for windows (regarding the windows specific code and if conditions and the statement in the documentation that it is build for windows). This could later be extended when the software is ported and tested on other systems, too.

@CharlieGPA40 CharlieGPA40 self-assigned this Mar 5, 2025
@CharlieGPA40
Copy link
Owner

Hi @domna

I have implemented a fix for this issue by:

  1. Ensuring pip install is not executed at runtime.

    QuDAP/README.md

    Lines 64 to 90 in 15a22af

    ### 2. Option 2 - Clone the Repository
    or installed from source:
    ```bash
    git clone https://github.com/CharlieGPA40/QuDAP.git
    cd QuDAP
    pip install .
    ```
    ### 3. Generate Your Own Requirements File (Optional)
    If you prefer installing pinned dependencies (exact versions for reproducibility), you can create a 'requirements.txt' from the 'pyproject.toml' using pip-tools. This way, you control which versions get installed without QuDAP shipping a pre-generated file.
    1. Install 'pip-tools':
    ```bash
    pip install pip-tools
    ```
    2. Compile dependencies from 'pyproject.toml':
    ```bash
    pip-compile --output-file requirements.txt pyproject.toml
    ```
    ### 4. Install Dependencies
    You have two primary options:
    1. Install 'pyproject.toml':
    ```bash
    pip install .
    ```
    This reads '[QuDAP] dependencies' in 'pyproject.toml' and installs the most recent compatible versions.
    2. Install from your compiled 'requirements.txt' (for locked versions):

  2. Adding dependency management via pyproject.toml.

    QuDAP/pyproject.toml

    Lines 16 to 17 in 15a22af

    dependencies = [
    "PyQt6",

  3. Changing the Operating System to Windows.

"Operating System :: Microsoft :: Windows",

  1. Providing instructions for users to generate their own requirements.txt using pip-tools.Let me know if you need any modifications.

QuDAP/README.md

Lines 71 to 81 in 15a22af

### 3. Generate Your Own Requirements File (Optional)
If you prefer installing pinned dependencies (exact versions for reproducibility), you can create a 'requirements.txt' from the 'pyproject.toml' using pip-tools. This way, you control which versions get installed without QuDAP shipping a pre-generated file.
1. Install 'pip-tools':
```bash
pip install pip-tools
```
2. Compile dependencies from 'pyproject.toml':
```bash
pip-compile --output-file requirements.txt pyproject.toml
```

Thanks for all your comment. Let me know if there is any more modifications needed.

Best regards,
Chunli Tang

@domna
Copy link
Author

domna commented Mar 11, 2025

Hey @CharlieGPA40,

thank you for the changes. I'll check them soon when I have more time, just one small quick remark to point 5: In my view the requirements.txt is not for the user to generate their own dependencies. It is rather to be produced during development by you from pyproject.toml. That way any devs are able to reproduce your exact development environment (in case there are some dependency issues). It also serves to ensure that there are no dependency conflicts one might overlook. Often this is also used in CI/CD to get a reproducible build (otherwise ci can break just from a dependency changing). Of course there are limitations (e.g., fixed python version to generate the dependencies for) but in my view this is best practice for python projects.

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