How do I upgrade the Python runtime version from 3...
# general
n
How do I upgrade the Python runtime version from 3.11 to 3.13? I have c7n 0.9.45 and Python 3.9.6 installed on my Mac, but when I deploy a policy, it uses Python 3.11. It appears the setting is configured within c7n itself.
a
You can provide a
runtime
in your
mode
block, where the currently supported values (from here as an example) are:
Copy code
- python3.10
    - python3.11
    - python3.12
    - python3.13
But yes the default is currently
python3.11
(we're probably about due to bump the default anyway though)
n
@AJ Kerrigan Thanks I found the setting in
mu.py
.
Copy code
@property
    def runtime(self):
        return self.policy.data['mode'].get('runtime', 'python3.11')

    @property
    def memory_size(self):
        return self.policy.data['mode'].get('memory', 512)

    @property
    def timeout(self):
        return self.policy.data['mode'].get('timeout', 900)
I specified
python3.13
and got following error. It seems c7n only supports up to
python3.12
.
Copy code
% custodian run -s ~/Documents/$(date +%Y-%m-%d) --cache-period 0 config-custom-efs-unused-acp-daily.yml
2025-09-05 10:03:56,633: custodian.commands:ERROR invalid policy file: config-custom-efs-unused-acp-daily.yml error: Failed to validate policy unknown 
             Error on policy:config-custom-efs-unused-acp-daily resource:efs
'python3.13' is not one of ['python3.8', 'python3.9', 'python3.10', 'python3.11', 'python3.12']

            Failed validating 'enum' in schema[8]['properties']['runtime']:
                {'enum': ['python3.8',
                          'python3.9',
                          'python3.10',
                          'python3.11',
                          'python3.12']}

            On instance['runtime']:
                'python3.13'
2025-09-05 10:03:56,633: custodian.commands:ERROR Found 1 errors.  Exiting.
Additionally, I tried to upgrade my c7n version from 0.9.45 to 0.9.46, but the latest version is not available to me. Is this affecting only me, or is this a known issue?
Copy code
% pip index versions c7n
c7n (0.9.45)
Available versions: 0.9.45, 0.9.44, 0.9.43, 0.9.42, 0.9.41, 0.9.40, 0.9.39, 0.9.38, 0.9.37, 0.9.36, 0.9.35, 0.9.34, 0.9.33, 0.9.32, 0.9.31, 0.9.30, 0.9.29, 0.9.28, 0.9.27, 0.9.26, 0.9.25, 0.9.24, 0.9.23, 0.9.22, 0.9.21, 0.9.20, 0.9.19, 0.9.18, 0.9.17, 0.9.16, 0.9.15, 0.9.14, 0.9.13, 0.9.12, 0.9.11, 0.9.10, 0.9.9, 0.9.8, 0.9.7, 0.9.6, 0.9.5, 0.9.4, 0.9.3, 0.9.2, 0.9.1, 0.8.46.1, 0.8.46.0, 0.8.45.4, 0.8.45.3, 0.8.45.2, 0.8.45.1, 0.8.45.0, 0.8.44.3, 0.8.44.2, 0.8.44.1, 0.8.44.0, 0.8.43.1, 0.8.43.0, 0.8.42.1, 0.8.42.0, 0.8.41.0, 0.8.40.0, 0.8.33.1, 0.8.33.0, 0.8.32.1, 0.8.32.0, 0.8.31.2, 0.8.31.1, 0.8.31.0, 0.8.30.0, 0.8.28.2, 0.8.28.1, 0.8.28.0, 0.8.27.3, 0.8.27.2, 0.8.27.1, 0.8.27.0, 0.8.26.1, 0.8.26.0, 0.8.25.2, 0.8.25.1, 0.8.25.0, 0.8.24.5, 0.8.24.4, 0.8.24.3, 0.8.24.2, 0.8.24.1, 0.8.24.0, 0.8.23.2, 0.8.23.1, 0.8.23.0, 0.8.22.0, 0.8.21.2, 0.8.21.1, 0.8.21.0, 0.8.20.2, 0.8.20.1, 0.8.20.0, 0.8.19.7, 0.8.19.6, 0.8.19.5, 0.8.19.4, 0.8.19.3, 0.8.19.2, 0.8.19.1, 0.8.19, 0.8.18.1, 0.8.18, 0.8.17.4, 0.8.17.3, 0.8.17.2, 0.8.17.1, 0.8.17, 0.8.16.6, 0.8.16.5, 0.8.16.4, 0.8.16.3, 0.8.16.2, 0.8.16.1, 0.8.16, 0.8.15.3, 0.8.15.2, 0.8.15.1, 0.8.15, 0.8.14.4, 0.8.14.3, 0.8.14.2, 0.8.14.1, 0.8.14, 0.8.13.6, 0.8.13.5, 0.8.13.4, 0.8.13.3, 0.8.13.2, 0.8.13.1, 0.8.13, 0.8.11, 0.8.9.2, 0.8.9.1, 0.8.8, 0.8.7, 0.8.5, 0.8.4, 0.8.3, 0.8.2
  INSTALLED: 0.9.45
  LATEST:    0.9.45
a
Oh good call, https://github.com/cloud-custodian/cloud-custodian/pull/10303 landed but isn't released yet. That'd cap you at 3.12 runtime for now. As for only seeing up to 0.9.45, c7n's minimum supported python versions was bumped in 0.9.46. So if your pip executable is using a python version less than
3.10.2
you won't see c7n 0.9.46 available.
👍 1