annotate python/new-python-project.py @ 865:20aa4a6ef719

python3
author Jeff Hammel <k0scist@gmail.com>
date Mon, 18 Jun 2018 14:48:41 -0700
parents 772c61f04ccf
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
530
772c61f04ccf python/new-python-project.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
1 #!/usr/bin/env python
772c61f04ccf python/new-python-project.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
2
772c61f04ccf python/new-python-project.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
3 """
772c61f04ccf python/new-python-project.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
4 makes a new python project.
772c61f04ccf python/new-python-project.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
5 """
772c61f04ccf python/new-python-project.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
6
772c61f04ccf python/new-python-project.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
7 import subprocess
772c61f04ccf python/new-python-project.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
8
772c61f04ccf python/new-python-project.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
9
772c61f04ccf python/new-python-project.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
10 - Make or utilize a virutalenv
772c61f04ccf python/new-python-project.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
11
772c61f04ccf python/new-python-project.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
12 @requires("makeitso")
772c61f04ccf python/new-python-project.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
13 - Make a project skeleton:
772c61f04ccf python/new-python-project.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
14
772c61f04ccf python/new-python-project.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
15 makeitso python-project -o ${PROJECT}
772c61f04ccf python/new-python-project.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
16
772c61f04ccf python/new-python-project.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
17 - Make a (mercurial) repository:
772c61f04ccf python/new-python-project.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
18
772c61f04ccf python/new-python-project.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
19 hg init .
772c61f04ccf python/new-python-project.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
20 hg add
772c61f04ccf python/new-python-project.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
21 hg commit -m '${PROJECT}: initial stub'
772c61f04ccf python/new-python-project.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
22
772c61f04ccf python/new-python-project.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
23 - Push upstream:
772c61f04ccf python/new-python-project.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
24
772c61f04ccf python/new-python-project.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
25 ssh k0s.org
772c61f04ccf python/new-python-project.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
26 cd hg; hg init ${PROJECT}
772c61f04ccf python/new-python-project.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
27 exit
772c61f04ccf python/new-python-project.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
28 hgrc http://k0s.org/hg/${PROJECT} > .hg/hgrc
772c61f04ccf python/new-python-project.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
29 hg push
772c61f04ccf python/new-python-project.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
30 """
772c61f04ccf python/new-python-project.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
31
772c61f04ccf python/new-python-project.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
32 # see also
772c61f04ccf python/new-python-project.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
33 # http://blog.ishans.info/2012/06/10/adding-a-template-for-new-python-files-in-emacs/
772c61f04ccf python/new-python-project.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
34
772c61f04ccf python/new-python-project.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
35 import optparse
772c61f04ccf python/new-python-project.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
36 import sys
772c61f04ccf python/new-python-project.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
37
772c61f04ccf python/new-python-project.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
38
772c61f04ccf python/new-python-project.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
39 def main(args=sys.argv[1:]):
772c61f04ccf python/new-python-project.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
40 pass
772c61f04ccf python/new-python-project.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
41
772c61f04ccf python/new-python-project.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
42 if __name__ == '__main__':
772c61f04ccf python/new-python-project.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
43 main()