(self, filename)
| 85 | class VersionMixin: |
| 86 | |
| 87 | def _fix_version(self, filename): |
| 88 | # Replace asyncpg.__version__ with the actual version |
| 89 | # of the distribution (possibly inferred from git). |
| 90 | |
| 91 | with open(str(filename)) as f: |
| 92 | content = f.read() |
| 93 | |
| 94 | version_re = r"(.*__version__\s*=\s*)'[^']+'(.*)" |
| 95 | repl = r"\1'{}'\2".format(self.distribution.metadata.version) |
| 96 | content = re.sub(version_re, repl, content) |
| 97 | |
| 98 | with open(str(filename), 'w') as f: |
| 99 | f.write(content) |
| 100 | |
| 101 | |
| 102 | class sdist(setuptools_sdist.sdist, VersionMixin): |
no test coverage detected