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

Python 3.12 Escapue Sequence Error #167

Open
fennewald opened this issue Aug 21, 2024 · 3 comments
Open

Python 3.12 Escapue Sequence Error #167

fennewald opened this issue Aug 21, 2024 · 3 comments

Comments

@fennewald
Copy link

When using cloudsmit-cli on Python 3.12+, startup begins with a wall of warnings:

λ cloudsmith
/home/c/.rye/tools/cloudsmith-cli/lib/python3.12/site-packages/cloudsmith_api/models/cran_upstream.py:431: SyntaxWarning: invalid escape sequence '\/'
  name is not None and not re.search('^\\w[\\w \\-\'\\.\/()]+$', name)):  # noqa: E501
/home/c/.rye/tools/cloudsmith-cli/lib/python3.12/site-packages/cloudsmith_api/models/cran_upstream_request.py:393: SyntaxWarning: invalid escape sequence '\/'
  name is not None and not re.search('^\\w[\\w \\-\'\\.\/()]+$', name)):  # noqa: E501
/home/c/.rye/tools/cloudsmith-cli/lib/python3.12/site-packages/cloudsmith_api/models/cran_upstream_request_patch.py:393: SyntaxWarning: invalid escape sequence '\/'
  name is not None and not re.search('^\\w[\\w \\-\'\\.\/()]+$', name)):  # noqa: E501
/home/c/.rye/tools/cloudsmith-cli/lib/python3.12/site-packages/cloudsmith_api/models/dart_upstream.py:431: SyntaxWarning: invalid escape sequence '\/'
  name is not None and not re.search('^\\w[\\w \\-\'\\.\/()]+$', name)):  # noqa: E501
/home/c/.rye/tools/cloudsmith-cli/lib/python3.12/site-packages/cloudsmith_api/models/dart_upstream_request.py:393: SyntaxWarning: invalid escape sequence '\/'
  name is not None and not re.search('^\\w[\\w \\-\'\\.\/()]+$', name)):  # noqa: E501
/home/c/.rye/tools/cloudsmith-cli/lib/python3.12/site-packages/cloudsmith_api/models/dart_upstream_request_patch.py:393: SyntaxWarning: invalid escape sequence '\/'
  name is not None and not re.search('^\\w[\\w \\-\'\\.\/()]+$', name)):  # noqa: E501
/home/c/.rye/tools/cloudsmith-cli/lib/python3.12/site-packages/cloudsmith_api/models/deb_upstream.py:527: SyntaxWarning: invalid escape sequence '\/'
  name is not None and not re.search('^\\w[\\w \\-\'\\.\/()]+$', name)):  # noqa: E501
/home/c/.rye/tools/cloudsmith-cli/lib/python3.12/site-packages/cloudsmith_api/models/deb_upstream_request.py:489: SyntaxWarning: invalid escape sequence '\/'
  name is not None and not re.search('^\\w[\\w \\-\'\\.\/()]+$', name)):  # noqa: E501
/home/c/.rye/tools/cloudsmith-cli/lib/python3.12/site-packages/cloudsmith_api/models/deb_upstream_request_patch.py:488: SyntaxWarning: invalid escape sequence '\/'
  name is not None and not re.search('^\\w[\\w \\-\'\\.\/()]+$', name)):  # noqa: E501
/home/c/.rye/tools/cloudsmith-cli/lib/python3.12/site-packages/cloudsmith_api/models/docker_upstream.py:431: SyntaxWarning: invalid escape sequence '\/'
  name is not None and not re.search('^\\w[\\w \\-\'\\.\/()]+$', name)):  # noqa: E501
/home/c/.rye/tools/cloudsmith-cli/lib/python3.12/site-packages/cloudsmith_api/models/docker_upstream_request.py:393: SyntaxWarning: invalid escape sequence '\/'
  name is not None and not re.search('^\\w[\\w \\-\'\\.\/()]+$', name)):  # noqa: E501
/home/c/.rye/tools/cloudsmith-cli/lib/python3.12/site-packages/cloudsmith_api/models/docker_upstream_request_patch.py:393: SyntaxWarning: invalid escape sequence '\/'
  name is not None and not re.search('^\\w[\\w \\-\'\\.\/()]+$', name)):  # noqa: E501
/home/c/.rye/tools/cloudsmith-cli/lib/python3.12/site-packages/cloudsmith_api/models/helm_upstream.py:431: SyntaxWarning: invalid escape sequence '\/'
  name is not None and not re.search('^\\w[\\w \\-\'\\.\/()]+$', name)):  # noqa: E501
/home/c/.rye/tools/cloudsmith-cli/lib/python3.12/site-packages/cloudsmith_api/models/helm_upstream_request.py:393: SyntaxWarning: invalid escape sequence '\/'
  name is not None and not re.search('^\\w[\\w \\-\'\\.\/()]+$', name)):  # noqa: E501
/home/c/.rye/tools/cloudsmith-cli/lib/python3.12/site-packages/cloudsmith_api/models/helm_upstream_request_patch.py:393: SyntaxWarning: invalid escape sequence '\/'
  name is not None and not re.search('^\\w[\\w \\-\'\\.\/()]+$', name)):  # noqa: E501
/home/c/.rye/tools/cloudsmith-cli/lib/python3.12/site-packages/cloudsmith_api/models/maven_upstream.py:431: SyntaxWarning: invalid escape sequence '\/'
  name is not None and not re.search('^\\w[\\w \\-\'\\.\/()]+$', name)):  # noqa: E501
/home/c/.rye/tools/cloudsmith-cli/lib/python3.12/site-packages/cloudsmith_api/models/maven_upstream_request.py:393: SyntaxWarning: invalid escape sequence '\/'
  name is not None and not re.search('^\\w[\\w \\-\'\\.\/()]+$', name)):  # noqa: E501
/home/c/.rye/tools/cloudsmith-cli/lib/python3.12/site-packages/cloudsmith_api/models/maven_upstream_request_patch.py:393: SyntaxWarning: invalid escape sequence '\/'
  name is not None and not re.search('^\\w[\\w \\-\'\\.\/()]+$', name)):  # noqa: E501
/home/c/.rye/tools/cloudsmith-cli/lib/python3.12/site-packages/cloudsmith_api/models/npm_upstream.py:431: SyntaxWarning: invalid escape sequence '\/'
  name is not None and not re.search('^\\w[\\w \\-\'\\.\/()]+$', name)):  # noqa: E501
/home/c/.rye/tools/cloudsmith-cli/lib/python3.12/site-packages/cloudsmith_api/models/npm_upstream_request.py:393: SyntaxWarning: invalid escape sequence '\/'
  name is not None and not re.search('^\\w[\\w \\-\'\\.\/()]+$', name)):  # noqa: E501
/home/c/.rye/tools/cloudsmith-cli/lib/python3.12/site-packages/cloudsmith_api/models/npm_upstream_request_patch.py:393: SyntaxWarning: invalid escape sequence '\/'
  name is not None and not re.search('^\\w[\\w \\-\'\\.\/()]+$', name)):  # noqa: E501
/home/c/.rye/tools/cloudsmith-cli/lib/python3.12/site-packages/cloudsmith_api/models/nuget_upstream.py:431: SyntaxWarning: invalid escape sequence '\/'
  name is not None and not re.search('^\\w[\\w \\-\'\\.\/()]+$', name)):  # noqa: E501
/home/c/.rye/tools/cloudsmith-cli/lib/python3.12/site-packages/cloudsmith_api/models/nuget_upstream_request.py:393: SyntaxWarning: invalid escape sequence '\/'
  name is not None and not re.search('^\\w[\\w \\-\'\\.\/()]+$', name)):  # noqa: E501
/home/c/.rye/tools/cloudsmith-cli/lib/python3.12/site-packages/cloudsmith_api/models/nuget_upstream_request_patch.py:393: SyntaxWarning: invalid escape sequence '\/'
  name is not None and not re.search('^\\w[\\w \\-\'\\.\/()]+$', name)):  # noqa: E501
/home/c/.rye/tools/cloudsmith-cli/lib/python3.12/site-packages/cloudsmith_api/models/python_upstream.py:431: SyntaxWarning: invalid escape sequence '\/'
  name is not None and not re.search('^\\w[\\w \\-\'\\.\/()]+$', name)):  # noqa: E501
/home/c/.rye/tools/cloudsmith-cli/lib/python3.12/site-packages/cloudsmith_api/models/python_upstream_request.py:393: SyntaxWarning: invalid escape sequence '\/'
  name is not None and not re.search('^\\w[\\w \\-\'\\.\/()]+$', name)):  # noqa: E501
/home/c/.rye/tools/cloudsmith-cli/lib/python3.12/site-packages/cloudsmith_api/models/python_upstream_request_patch.py:393: SyntaxWarning: invalid escape sequence '\/'
  name is not None and not re.search('^\\w[\\w \\-\'\\.\/()]+$', name)):  # noqa: E501
/home/c/.rye/tools/cloudsmith-cli/lib/python3.12/site-packages/cloudsmith_api/models/repository.py:831: SyntaxWarning: invalid escape sequence '\/'
  name is not None and not re.search('^\\w[\\w \\-\'\\.\/()]+$', name)):  # noqa: E501
/home/c/.rye/tools/cloudsmith-cli/lib/python3.12/site-packages/cloudsmith_api/models/repository_create.py:831: SyntaxWarning: invalid escape sequence '\/'
  name is not None and not re.search('^\\w[\\w \\-\'\\.\/()]+$', name)):  # noqa: E501
/home/c/.rye/tools/cloudsmith-cli/lib/python3.12/site-packages/cloudsmith_api/models/repository_create_request.py:592: SyntaxWarning: invalid escape sequence '\/'
  name is not None and not re.search('^\\w[\\w \\-\'\\.\/()]+$', name)):  # noqa: E501
/home/c/.rye/tools/cloudsmith-cli/lib/python3.12/site-packages/cloudsmith_api/models/repository_request_patch.py:586: SyntaxWarning: invalid escape sequence '\/'
  name is not None and not re.search('^\\w[\\w \\-\'\\.\/()]+$', name)):  # noqa: E501
/home/c/.rye/tools/cloudsmith-cli/lib/python3.12/site-packages/cloudsmith_api/models/rpm_upstream.py:488: SyntaxWarning: invalid escape sequence '\/'
  name is not None and not re.search('^\\w[\\w \\-\'\\.\/()]+$', name)):  # noqa: E501
/home/c/.rye/tools/cloudsmith-cli/lib/python3.12/site-packages/cloudsmith_api/models/rpm_upstream_request.py:450: SyntaxWarning: invalid escape sequence '\/'
  name is not None and not re.search('^\\w[\\w \\-\'\\.\/()]+$', name)):  # noqa: E501
/home/c/.rye/tools/cloudsmith-cli/lib/python3.12/site-packages/cloudsmith_api/models/rpm_upstream_request_patch.py:449: SyntaxWarning: invalid escape sequence '\/'
  name is not None and not re.search('^\\w[\\w \\-\'\\.\/()]+$', name)):  # noqa: E501
/home/c/.rye/tools/cloudsmith-cli/lib/python3.12/site-packages/cloudsmith_api/models/ruby_upstream.py:431: SyntaxWarning: invalid escape sequence '\/'
  name is not None and not re.search('^\\w[\\w \\-\'\\.\/()]+$', name)):  # noqa: E501
/home/c/.rye/tools/cloudsmith-cli/lib/python3.12/site-packages/cloudsmith_api/models/ruby_upstream_request.py:393: SyntaxWarning: invalid escape sequence '\/'
  name is not None and not re.search('^\\w[\\w \\-\'\\.\/()]+$', name)):  # noqa: E501
/home/c/.rye/tools/cloudsmith-cli/lib/python3.12/site-packages/cloudsmith_api/models/ruby_upstream_request_patch.py:393: SyntaxWarning: invalid escape sequence '\/'
  name is not None and not re.search('^\\w[\\w \\-\'\\.\/()]+$', name)):  # noqa: E501
/home/c/.rye/tools/cloudsmith-cli/lib/python3.12/site-packages/cloudsmith_api/models/swift_upstream.py:431: SyntaxWarning: invalid escape sequence '\/'
  name is not None and not re.search('^\\w[\\w \\-\'\\.\/()]+$', name)):  # noqa: E501
/home/c/.rye/tools/cloudsmith-cli/lib/python3.12/site-packages/cloudsmith_api/models/swift_upstream_request.py:393: SyntaxWarning: invalid escape sequence '\/'
  name is not None and not re.search('^\\w[\\w \\-\'\\.\/()]+$', name)):  # noqa: E501
/home/c/.rye/tools/cloudsmith-cli/lib/python3.12/site-packages/cloudsmith_api/models/swift_upstream_request_patch.py:393: SyntaxWarning: invalid escape sequence '\/'
  name is not None and not re.search('^\\w[\\w \\-\'\\.\/()]+$', name)):  # noqa: E501
Usage: cloudsmith [OPTIONS] COMMAND [ARGS]...

     ________                __               _ __  __       ________    ____
    / ____/ /___  __  ______/ /________ ___  (_) /_/ /_     / ____/ /   /  _/
   / /   / / __ \/ / / / __  / ___/ __ `__ \/ / __/ __ \   / /   / /    / /
  / /___/ / /_/ / /_/ / /_/ (__  ) / / / / / / /_/ / / /  / /___/ /____/ /
  \____/_/\____/\__,_/\__,_/____/_/ /_/ /_/_/\__/_/ /_/   \____/_____/___/

  The Cloudsmith Command-Line Interface - Be Awesome. Automate Everything.

Options:
  -V, --version            Show the version numbers for the API and CLI.
  -C, --config-file PATH   The path to your config.ini file.
  --credentials-file PATH  The path to your credentials.ini file.
  -P, --profile TEXT       The name of the profile to use for configuration.
  -h, --help               Show this message and exit.

Commands:
  check               Check rate limits and service status.
  copy|cp             Copy a package to another repository.
  delete|rm           Delete a package from a repository.
  dependencies|deps   List direct (non-transitive) dependencies for a...
  docs                Launch the help website in your browser.
  entitlements|ents   Manage the entitlements for a repository.
  help                Show this delightful help message and exit.
  list|ls             List distros, packages, repos and entitlements.
  login|token         Retrieve your API authentication token/key via login.
  metrics             Retrieve Metrics.
  move|mv|promote     Move (promote) a package to another repo.
  policy              Manage policies for an organization.
  push|upload|deploy  Push (upload) a new package to a repository.
  quarantine|block    Manage quarantined packages in a repository.
  quota               Display Quota limits and history for an organisation.
  repositories|repos  Manage Repositories.
  resync              Resynchronise a package in a repository.
  status              Get the synchronisation status for a package.
  tags|tag            Manage the tags for a package in a repository.
  upstream            Manage upstreams for a repository.
  whoami              Retrieve your current authentication status.

  For more help, see the docs: https://help.cloudsmith.io/docs/cli/

  For issues/contributing: https://github.com/cloudsmith-io/cloudsmith-cli

It looks like this regex pattern, which has been copied to several locations, uses a now-invalid escape sequence. These should probably all be raw strings.

@fennewald
Copy link
Author

Was just going to fix this, but it looks like it's inside autogenerated API code? Unsure where exactly to find the actual contents

@nickxn
Copy link

nickxn commented Sep 17, 2024

Thanks for raising @fennewald ! We'll take a look

@konstin
Copy link

konstin commented Oct 16, 2024

I'm getting the same error on the first run after uv pip install cloudsmith-cli. The syntax warning is only raised when there was no bytecode compilation yet, so it isn't showing with pip or after the first run.

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

No branches or pull requests

3 participants