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

SyntaxWarning on Python 3.12 #677

Open
2 tasks done
ctcjab opened this issue Sep 5, 2024 · 6 comments
Open
2 tasks done

SyntaxWarning on Python 3.12 #677

ctcjab opened this issue Sep 5, 2024 · 6 comments

Comments

@ctcjab
Copy link

ctcjab commented Sep 5, 2024

Checklist

  • I added a descriptive title
  • I searched open reports and couldn't find a duplicate

What happened?

After installing the latest version of conda-lock via pixi global install conda-lock, invoking conda-lock results in SyntaxWarning spam in the console output:

$ conda-lock --version
/pixi/envs/conda-lock/lib/python3.12/site-packages/clikit/utils/string.py:81: SyntaxWarning: invalid escape sequence '\s'
  words = re.split("\s+", string)
/pixi/envs/conda-lock/lib/python3.12/site-packages/clikit/api/args/format/command_option.py:47: SyntaxWarning: invalid escape sequence '\-'
  if not re.match("^[a-zA-Z0-9\-]+$", alias):
conda-lock, version 2.5.7

Additional Context

The offending code is in clikit, but it looks like that code has since been fixed (note it now uses a r"raw string literal" as it should have in the first place).

I looked through conda-lock's pyproject.toml to see if fixing this is just a matter of updating a >= constraint on clikit, but I didn't see clikit declared in dependencies. Perhaps it's getting pulled in transitively, but (ironically) I couldn't find a lockfile that mentioned it when I searched the code.

Note this reproduces with a fresh install of the latest version of conda-lock via pixi global install conda-lock, but does not reproduce when installing via other tools I've tested, e.g. uv tool install conda-lock.

@ctcjab
Copy link
Author

ctcjab commented Sep 5, 2024

In case it's relevant, this reproduces when using the latest version of pixi to install conda-lock, namely 0.29.0.

@maresb
Copy link
Contributor

maresb commented Sep 5, 2024

Thanks a lot @ctcjab for the report! We just removed the clikit dependency in #637. Unfortunately that broke some other stuff, so we can't release it yet.

BTW I am very curious why you use conda-lock in addition to pixi. (See also #615)

@ctcjab
Copy link
Author

ctcjab commented Sep 5, 2024

Thanks @maresb, good to know. Out of curiosity, any idea why this doesn't reproduce when installed with e.g. uv tool install?

I use conda-lock in addition to pixi because I work with a large number of codebases, most of which are not mine, and all of which have limited resources for migrations. I've been tracking #615 with interest, and am excited to understand the best path forward for existing conda-lock users, as well as for conda users who are not currently using lockfiles and may be interested to leapfrog straight to pixi.

@ctcjab
Copy link
Author

ctcjab commented Sep 13, 2024

Oh, the only reason this didn't reproduce with uv tool install is that it used an older Python version. I just tried uv tool install conda-lock --python 3.12 and then with that installation this issue reproduced.

@maresb
Copy link
Contributor

maresb commented Sep 13, 2024

Cool, thanks a lot @ctcjab for tracking that down!!!

Any way I could get you to test main? I'm really close to a new major release.

@ctcjab
Copy link
Author

ctcjab commented Sep 13, 2024

Just did a uv pip install -e . from the latest revision of main in a python 3.12 venv, and when I invoked the conda-lock that got installed there, this did not reproduce. Awesome!

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