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

Use the tox-oldest plugin #16309

Closed
nstarman opened this issue Apr 18, 2024 · 4 comments
Closed

Use the tox-oldest plugin #16309

nstarman opened this issue Apr 18, 2024 · 4 comments

Comments

@nstarman
Copy link
Member

nstarman commented Apr 18, 2024

What is the problem this feature will solve?

We should get rid of our manual specification of oldest dependencies in tox.ini and instead use the constraints from our pyproject.toml

Describe the desired outcome

tox's oldestdeps environment should pull in the oldest version information from pyproject.toml. We should only have to specify version info in one place, not in both the toml and tox.ini.

Additional context

I asked chat-gpt to solve this:

Got it, you want to use tox with your pyproject.toml file to create an environment called "oldestdeps" that installs the oldest version of each dependency. You can achieve this by configuring tox to use the tox-oldest plugin.

Here's how you can do it:

  1. Install tox-oldest:
    First, you need to install the tox-oldest plugin:

    pip install tox-oldest
    
  2. Update your pyproject.toml:
    Make sure your pyproject.toml contains the dependencies you want to test with. Specify the constraints for each dependency if necessary.

  3. Create a tox.ini file:
    In your project directory, create a tox.ini file and configure it to use the tox-oldest plugin.

    Example tox.ini:

    [tox]
    envlist = oldestdeps
    
    [testenv]
    deps = tox-oldest
    
    [testenv:oldestdeps]
    deps =
        tox-oldest
    commands =
        tox-oldest
  4. Run tox:
    Now you can run tox with the specified environment oldestdeps:

    tox -e oldestdeps
    

This will create an environment named "oldestdeps" and install the oldest version of each dependency specified in your pyproject.toml file. Make sure to review the output to ensure that the correct versions are being installed.

With this setup tox will directly use your pyproject.toml file for dependency management.

@nstarman
Copy link
Member Author

perhaps a Chat-GPT hallucination. Too good to be true!

@nstarman nstarman closed this as not planned Won't fix, can't repro, duplicate, stale Apr 18, 2024
@astrofrog
Copy link
Member

Next prompt for ChatGPT: could you write the main plugin code for tox-oldest?

@MridulS
Copy link
Contributor

MridulS commented Apr 25, 2024

Wait can't we do this with #16201? --resolution=lowest-direct is supported by uv and the oldestdep requirements can be spun up on demand with that.

@nstarman
Copy link
Member Author

Yes please.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

No branches or pull requests

4 participants