Skip to content

use_scm_version sometimes used, sometimes not #1022

@dhduvall

Description

@dhduvall

I've been struggling for a day to figure out why in some cases, a custom setup.py with a call to setup(use_scm_version...), the custom version function I have is called, and others, it's ignored. I'm sure it'll be obvious, but I'm stumped.

If I run python -m setuptools_scm, it looks like setup.py is never even loaded, so I've only been able to get it to work from an installer (I'm using uv, but pip seems to have the same behavior). Unfortunately, the installer creates an ephemeral isolated virtual environment, so I can't tweak the code in either setuptools or setuptools_scm to help debug.

It works in my primary development environment on my laptop, as well as in a freshly cloned repo on the same machine, even in a different shell. I also created a fresh repo with just the bare minimum of things in it for the installer to run, and it works there as well. Presumably this means there's something installed on this machine that's making it work.

It works in GitLab CI, in a job using nikolaik/python-nodejs:python3.10-nodejs20-bullseye as the image (Debian based), as well in this image in a container on my laptop (the container is x86_64, the laptop is apple silicon).

It fails in GitLab CI, in a job using ubuntu:22.04, as well as a VM of my own running the same.

I've tried to eliminate all the variables between different experiments, so I'm reasonably confident that the difference lies in what's installed on the machine, but that's pretty big and I don't know where to start to narrow that down.

Can anyone suggest what my next step should be?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions