Merge pull request #1314 from goodwillcoding/1.5-branch
backport #1313 which is addition to #1300
| | |
| | | # get pyramid package version |
| | | pyramid_version = self.pyramid_dist.version |
| | | |
| | | # map pyramid package version of the documentation branch |
| | | # by finding the version.major version |
| | | vmatch = re.match(r'(\d+\.\d+)', self.pyramid_dist.version) |
| | | if vmatch is not None: |
| | | pyramid_docs_branch = "%s-branch" % vmatch.group() |
| | | ## map pyramid package version of the documentation branch ## |
| | | # if version ends with 'dev' then docs version is 'master' |
| | | if self.pyramid_dist.version[-3:] == 'dev': |
| | | pyramid_docs_branch = 'master' |
| | | else: |
| | | pyramid_docs_branch = 'latest' |
| | | # if not version is not 'dev' find the version.major_version string |
| | | # and combine it with '-branch' |
| | | version_match = re.match(r'(\d+\.\d+)', self.pyramid_dist.version) |
| | | if version_match is not None: |
| | | pyramid_docs_branch = "%s-branch" % version_match.group() |
| | | # if can not parse the version then default to 'latest' |
| | | else: |
| | | pyramid_docs_branch = 'latest' |
| | | |
| | | vars = { |
| | | 'project': project_name, |
| | |
| | | scaffold.vars, |
| | | {'project': 'Distro', 'egg': 'Distro', 'package': 'distro', |
| | | 'pyramid_version': '0.12dev', |
| | | 'pyramid_docs_branch': '0.12-branch'}) |
| | | 'pyramid_docs_branch': 'master'}) |
| | | |
| | | def test_scaffold_with_dev_pyramid_long_version(self): |
| | | cmd = self._makeOne('-s', 'dummy', 'Distro') |
| | |
| | | scaffold.vars, |
| | | {'project': 'Distro', 'egg': 'Distro', 'package': 'distro', |
| | | 'pyramid_version': '0.10.1dev', |
| | | 'pyramid_docs_branch': '0.10-branch'}) |
| | | 'pyramid_docs_branch': 'master'}) |
| | | |
| | | |
| | | class Test_main(unittest.TestCase): |