Skip to content

Commit c569be0

Browse files
committed
Use Pipenv and fix various Python 3 problems
1 parent bd655e3 commit c569be0

File tree

6 files changed

+315
-4
lines changed

6 files changed

+315
-4
lines changed

docs/Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,3 +260,6 @@ $(BUILDDIR)/index/404.html: 404.html $(BUILDDIR)/index/index.html
260260

261261
.PHONY: release-index
262262
release-index: $(BUILDDIR)/index/index.html $(BUILDDIR)/index/404.html $(BUILDDIR)/index/latest/index.html
263+
264+
deploy-release-index: release-index
265+
aws s3 cp --region=eu-west-1 target/index/index.html s3://hyper.wickstrom.tech/index.html

docs/Pipfile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[[source]]
2+
name = "pypi"
3+
url = "https://pypi.org/simple"
4+
verify_ssl = true
5+
6+
[dev-packages]
7+
8+
[packages]
9+
tornado = "<5.0.0"
10+
semver = "*"
11+
sphinx-autobuild = "*"
12+
Sphinx = "*"
13+
14+
[requires]
15+
python_version = "3.6"

docs/Pipfile.lock

Lines changed: 292 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/bin/make-index-page.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ print_row() {
1616
"
1717
}
1818

19-
versions=$(aws s3 ls hyper.wickstrom.tech/docs/ | awk '{print $2}' | sed 's/\///' | $DIR/sort_by_semver.py)
19+
versions=$(aws s3 ls --region=eu-west-1 hyper.wickstrom.tech/docs/ | awk '{print $2}' | sed 's/\///' | $DIR/sort_by_semver.py)
2020
latest=$(echo $versions | head -n 1)
2121

2222
echo "

docs/bin/sort_by_semver.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/usr/bin/env python
22

3+
from functools import cmp_to_key
34
import fileinput
45
import semver
56

@@ -11,12 +12,12 @@ def cmp_semver(a, b):
1112
return cmp(a, b)
1213

1314

14-
def sort_versions(versions): return sorted(versions, cmp=cmp_semver,
15+
def sort_versions(versions): return sorted(versions, key=cmp_to_key(cmp_semver),
1516
reverse=True)
1617

1718

1819
def main():
19-
versions = map(lambda line: line.strip(), list(fileinput.input()))
20+
versions = map(lambda line: line.strip()[1:], list(fileinput.input()))
2021
sorted_versions = sort_versions(versions)
2122
for version in sorted_versions:
2223
print(version)

docs/src/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
# The short X.Y version.
3838

3939
def get_git_rev():
40-
return subprocess.Popen("git rev-parse --short HEAD", shell=True, stdout=subprocess.PIPE).stdout.read().strip()
40+
return str(subprocess.Popen("git rev-parse --short HEAD", shell=True, stdout=subprocess.PIPE).stdout.read().strip())
4141

4242
def get_version():
4343
version_env = os.environ.get("VERSION")

0 commit comments

Comments
 (0)