Exemple #1
0
 def __init__(self, version):
     if 'GITHUB_TOKEN' not in os.environ:
         logging.warning(
             'Unless GITHUB_TOKEN is specified, your requests will likely fail'
         )
     self.url = 'https://api.github.com'
     self.session = requests.Session()
     self.session.headers.update({
         'Accept':
         'application/vnd.github.v3+json',
         'Authorization':
         'token ' + os.environ.get('GITHUB_TOKEN', ''),
     })
     self.version = version or self.get_current_version()
     self.version_name = 'Version ' + self.version
 def __init__(self, github_token: str, dry_run: bool = False):
     self.url = 'https://api.github.com'
     self.releases_url = self.url + '/repos/thought-machine/please-servers/releases'
     self.upload_url = self.releases_url.replace(
         'api.', 'uploads.') + '/<id>/assets?name='
     self.session = requests.Session()
     self.session.verify = '/etc/ssl/certs/ca-certificates.crt'
     if not dry_run:
         self.session.headers.update({
             'Accept':
             'application/vnd.github.v3+json',
             'Authorization':
             'token ' + github_token,
         })
     self.version = self.read_file('VERSION').strip()
     self.version_name = 'Version ' + self.version
Exemple #3
0
 def __init__(self, github_token:str, dry_run:bool=False):
     self.url = 'https://api.github.com'
     self.releases_url = self.url + '/repos/thought-machine/please/releases'
     self.upload_url = self.releases_url.replace('api.', 'uploads.') + '/<id>/assets?name='
     self.session = requests.Session()
     self.session.verify = '/etc/ssl/certs/ca-certificates.crt'
     if not dry_run:
         self.session.headers.update({
             'Accept': 'application/vnd.github.v3+json',
             'Authorization': 'token ' + github_token,
         })
     self.version = self.read_file('VERSION').strip()
     self.version_name = 'Version ' + self.version
     self.is_prerelease = 'a' in self.version or 'b' in self.version
     self.known_content_types = {
         '.gz': 'application/gzip',
         '.xz': 'application/x-xz',
         '.asc': 'text/plain',
     }
Exemple #4
0
 def __init__(self,
              github_token: str,
              dry_run: bool = False,
              version: str = ''):
     self.url = 'https://api.github.com'
     self.please_url = self.url + '/repos/thought-machine/please/releases/latest'
     self.releases_url = self.url + '/repos/thought-machine/homebrew-please/releases'
     self.upload_url = self.releases_url.replace(
         'api.', 'uploads.') + '/<id>/assets?name='
     self.download_url = 'https://github.com/thought-machine/please/releases/download/v%s/please_%s_%s.tar.gz'
     self.session = requests.Session()
     self.session.verify = '/etc/ssl/certs/ca-certificates.crt'
     self.version = version or self.determine_version()
     logging.info('Releasing version %s', self.version)
     self.is_prerelease = 'a' in self.version or 'b' in self.version
     self.formula = self._extract_formula()
     self.original_formula = self.formula
     if not dry_run:
         self.session.headers.update({
             'Accept':
             'application/vnd.github.v3+json',
             'Authorization':
             'token ' + github_token,
         })