-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetup.py
57 lines (48 loc) · 1.57 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/usr/bin/env python
from setuptools import setup, find_packages
from setuptools import Command
class UploadGhPages(Command):
'''Command to update build and upload sphinx doc to github.'''
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
# Import fabric
try:
from fabric.api import local
# Import subprocess
except ImportError:
from subprocess import call
from functools import partial
local = partial(call, shell=True)
# Create gh-pages branch
local('git checkout --orphan gh-pages ')
# Unstage all
local('rm .git/index')
# Build doc
local('python setup.py build_sphinx')
# No jekyll file
local('touch .nojekyll')
local('git add .nojekyll')
# Add Readme
local('git add README.md')
# Add html content
local('git add docs/build/html/* -f ')
# Move html content
local('git mv docs/build/html/* ./ ')
# Git commit
local('git commit -m "build sphinx" ')
# Git push
local('git push --set-upstream origin gh-pages -f ')
# Back to master
local('git checkout master -f ')
# Delete branch
local('git branch -D gh-pages ')
setup(name = 'pygame-mvctools',
version = '0.1.0',
description = 'High-level set of modules designed for writing games.',
packages = find_packages(),
cmdclass = {'upload_gh_pages': UploadGhPages}
)