Skip to content

Commit

Permalink
Extend RTD facilities
Browse files Browse the repository at this point in the history
  • Loading branch information
bswck committed Feb 2, 2024
1 parent 01b07d4 commit a9b3d7b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
7 changes: 7 additions & 0 deletions jaraco/develop/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,13 @@ def parse(cls, line):
topics = topics_assigned and filter(None, topics_assigned.group(1).split(','))
return cls(match.name, tags=tags, topics=list(map(str.strip, topics or ())))

@property
def rtd_slug(self):
return self.replace('.', '').replace('_', '-')

@property
def rtd_url(self):
return f'https://{self.rtd_slug}.readthedocs.io/'


def resolve(name):
Expand Down
10 changes: 8 additions & 2 deletions jaraco/develop/rtd.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ def session():
return session


def rtd_exists(project):
return session().head(f'projects/{project.rtd_slug}/').ok


def enable_pr_build(project):
slug = project.replace('.', '').replace('_', '-')
session().patch(f'projects/{slug}/', data=dict(external_builds_enabled=True))
session().patch(
f'projects/{project.rtd_slug}/',
data=dict(external_builds_enabled=True),
)

0 comments on commit a9b3d7b

Please sign in to comment.