File: shared.py

package info (click to toggle)
pydantic 2.12.5-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 7,640 kB
  • sloc: python: 75,984; javascript: 181; makefile: 115; sh: 38
file content (15 lines) | stat: -rw-r--r-- 456 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
"""This module contains shared variables and functions for the release scripts."""

import subprocess


def run_command(*args: str) -> str:
    """Run a shell command and return the output."""
    p = subprocess.run(args, stdout=subprocess.PIPE, check=True, encoding='utf-8')
    return p.stdout.strip()


REPO = 'pydantic/pydantic'
HISTORY_FILE = 'HISTORY.md'
PACKAGE_VERSION_FILE = 'pydantic/version.py'
GITHUB_TOKEN = run_command('gh', 'auth', 'token')