-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsetup.py
executable file
·69 lines (60 loc) · 1.93 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
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/usr/bin/env python
from setuptools import setup, find_packages
from setuptools import Command
# Build and update pyqt resources
import sequence.resource.pyqt
del sequence
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='python-sequence',
version='0.1.1',
description='Package for sequence edition and execution.',
packages=find_packages(),
include_package_data=True,
package_data={'': ['*.png', '*.ui', '*.qrc']},
cmdclass={'upload_gh_pages': UploadGhPages},
entry_points={
'console_scripts': [
'sequence-console = sequence.console:main'],
'gui_scripts': [
'sequence-runner = sequence.runner:main',
'sequence-editor = sequence.editor:main']},
)