• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

badges / shields / 12851394349

18 Jan 2025 07:16PM UTC coverage: 91.115% (-1.4%) from 92.488%
12851394349

push

github

web-flow
fix badge-maker package tests (#10809)

6572 of 6836 branches covered (96.14%)

8 of 8 new or added lines in 3 files covered. (100.0%)

48 existing lines in 11 files now uncovered.

49254 of 54057 relevant lines covered (91.11%)

113.73 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

98.53
/services/python/python-version-from-toml.service.js
1
import Joi from 'joi'
1✔
2
import BaseTomlService from '../../core/base-service/base-toml.js'
1✔
3
import { queryParams } from '../index.js'
1✔
4
import { url } from '../validators.js'
1✔
5

1✔
6
const queryParamSchema = Joi.object({
1✔
7
  tomlFilePath: url,
1✔
8
}).required()
1✔
9

1✔
10
const schema = Joi.object({
1✔
11
  project: Joi.object({
1✔
12
    'requires-python': Joi.string().required(),
1✔
13
  }).required(),
1✔
14
}).required()
1✔
15

1✔
16
const description = `Shows the required python version for a package based on the values in the requires-python field in PEP 621 compliant pyproject.toml \n
1✔
17
a URL of the toml is required, please note that when linking to files in github or similar sites, provide URL to raw file, for example:
1✔
UNCOV
18

×
19
Use https://raw.githubusercontent.com/numpy/numpy/main/pyproject.toml \n
1✔
20
And not https://github.com/numpy/numpy/blob/main/pyproject.toml
1✔
21
`
1✔
22

1✔
23
class PythonVersionFromToml extends BaseTomlService {
1✔
24
  static category = 'platform-support'
3✔
25

3✔
26
  static route = {
3✔
27
    base: '',
3✔
28
    pattern: 'python/required-version-toml',
3✔
29
    queryParamSchema,
3✔
30
  }
3✔
31

3✔
32
  static openApi = {
3✔
33
    '/python/required-version-toml': {
3✔
34
      get: {
3✔
35
        summary: 'Python Version from PEP 621 TOML',
3✔
36
        description,
3✔
37
        parameters: queryParams({
3✔
38
          name: 'tomlFilePath',
3✔
39
          example:
3✔
40
            'https://raw.githubusercontent.com/numpy/numpy/main/pyproject.toml',
3✔
41
          required: true,
3✔
42
        }),
3✔
43
      },
3✔
44
    },
3✔
45
  }
3✔
46

3✔
47
  static defaultBadgeData = { label: 'python' }
3✔
48

3✔
49
  static render({ requiresPythonString }) {
3✔
50
    // we only show requries-python as is
1✔
51
    // for more info read the following issues:
1✔
52
    // https://github.com/badges/shields/issues/9410
1✔
53
    // https://github.com/badges/shields/issues/5551
1✔
54
    return {
1✔
55
      message: requiresPythonString,
1✔
56
      color: 'blue',
1✔
57
    }
1✔
58
  }
1✔
59

3✔
60
  async handle(namedParams, { tomlFilePath }) {
3✔
61
    const tomlData = await this._requestToml({ url: tomlFilePath, schema })
2✔
62
    const requiresPythonString = tomlData.project['requires-python']
1✔
63

1✔
64
    return this.constructor.render({ requiresPythonString })
1✔
65
  }
2✔
66
}
3✔
67

3✔
68
export { PythonVersionFromToml }
3✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc