Merge lp:~oubiwann/txaws/919862-add-makefile-old into lp:txaws

Proposed by Duncan McGreggor
Status: Merged
Approved by: Thomas Herve
Approved revision: 119
Merge reported by: Duncan McGreggor
Merged at revision: not available
Proposed branch: lp:~oubiwann/txaws/919862-add-makefile-old
Merge into: lp:txaws
Diff against target: 138 lines (+127/-0)
2 files modified
.bzrignore (+1/-0)
Makefile (+126/-0)
To merge this branch: bzr merge lp:~oubiwann/txaws/919862-add-makefile-old
Reviewer Review Type Date Requested Status
Thomas Herve Approve
Review via email: mp+89562@code.launchpad.net
To post a comment you must log in.
116. By Duncan McGreggor

Added missing target dependencies.

117. By Duncan McGreggor

Added another missing make target dependency.

118. By Duncan McGreggor

Added targets for uninstalling packages inside the virtual envs.

119. By Duncan McGreggor

With python-dateutil's PyPI downloads updated, we no longer need to download
directly from labix.org.

Revision history for this message
Thomas Herve (therve) wrote :

[1]
+build-docs:
+ cd docs/sphinx; make html

+upload-docs: build-docs
+ python setup.py upload_docs --upload-dir=docs/html/

AFAIK there is no such doc, so you should probably remove that.

[2] It's 2012, it'd be nice to default to something more recent than python 2.5 :).

[3]
+ -@test -d .venv-$(VERSION) || virtualenv -p Python$(VERSION) .venv-$(VERSION)

It smells like OS X here. The Python2.X executables (with a capital P) don't exist on Linux.

Thanks!

review: Approve
Revision history for this message
Thomas Herve (therve) wrote :

Oh, and you may need to add some paths to bzrignore.

Revision history for this message
Duncan McGreggor (oubiwann) wrote :

> [1]
> +build-docs:
> + cd docs/sphinx; make html
>
> +upload-docs: build-docs
> + python setup.py upload_docs --upload-dir=docs/html/
>
> AFAIK there is no such doc, so you should probably remove that.

Hehe, yeah -- there is none. I am planning to add one, but these targets can always be put back in once there's something actually there. And who knows when I'll really get to it...

> [2] It's 2012, it'd be nice to default to something more recent than python
> 2.5 :).

Hehehe. Good call; will change.

> [3]
> + -@test -d .venv-$(VERSION) || virtualenv -p Python$(VERSION)
> .venv-$(VERSION)
>
> It smells like OS X here. The Python2.X executables (with a capital P) don't
> exist on Linux.

Indeed ;-) I'll update the Makefile to do a check on uname and then put some conditionals in there.

> Thanks!

Sure thing :-)

Revision history for this message
Duncan McGreggor (oubiwann) wrote :

> Oh, and you may need to add some paths to bzrignore.

Will do!

120. By Duncan McGreggor

Removed docs targets, per review comment [1] of therve.

121. By Duncan McGreggor

Made 2.7 the default, per therve's recommendation in review comment [2].

122. By Duncan McGreggor

Added system checks and conditionals for binary names.

123. By Duncan McGreggor

Added ignores for virtual envs.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file '.bzrignore'
2--- .bzrignore 2012-01-18 15:00:32 +0000
3+++ .bzrignore 2012-01-24 22:10:28 +0000
4@@ -1,2 +1,3 @@
5 _trial_temp*
6 .testrepository
7+.venv-*
8
9=== added file 'Makefile'
10--- Makefile 1970-01-01 00:00:00 +0000
11+++ Makefile 2012-01-24 22:10:28 +0000
12@@ -0,0 +1,126 @@
13+PLATFORM = $(shell uname)
14+ifeq ($(PLATFORM), Darwin)
15+PYBIN = Python
16+else
17+PYBIN = python
18+endif
19+
20+
21+check-pybin:
22+ echo "$(PYBIN)"
23+
24+version:
25+ @python -c "from txaws import version;print version.txaws;"
26+
27+
28+clean:
29+ find ./ -name "*~" -exec rm {} \;
30+ find ./ -name "*.pyc" -exec rm {} \;
31+ find ./ -name "*.pyo" -exec rm {} \;
32+ find . -name "*.sw[op]" -exec rm {} \;
33+ rm -rf _trial_temp/ build/ dist/ MANIFEST *.egg-info
34+
35+
36+build:
37+ @python setup.py build
38+ @python setup.py sdist
39+
40+
41+virtual-dir-setup: VERSION ?= 2.7
42+virtual-dir-setup:
43+ -@test -d .venv-$(VERSION) || virtualenv -p $(PYBIN)$(VERSION) .venv-$(VERSION)
44+ -@test -e .venv-$(VERSION)/bin/twistd || . .venv-$(VERSION)/bin/activate && pip install twisted
45+ -@test -e .venv-$(VERSION)/bin/pep8 || . .venv-$(VERSION)/bin/activate && pip install pep8
46+ -@test -e .venv-$(VERSION)/bin/pyflakes || . .venv-$(VERSION)/bin/activate && pip install pyflakes
47+ -. .venv-$(VERSION)/bin/activate && pip install lxml
48+ -. .venv-$(VERSION)/bin/activate && pip install PyOpenSSL
49+ -. .venv-$(VERSION)/bin/activate && pip install venusian
50+ -. .venv-$(VERSION)/bin/activate && pip install 'python-dateutil<2.0'
51+
52+
53+virtual-builds:
54+ -@test -e "`which $(PYBIN)2.5`" && VERSION=2.5 make virtual-dir-setup || echo "Couldn't find $(PYBIN)2.5"
55+ -@test -e "`which $(PYBIN)2.6`" && VERSION=2.6 make virtual-dir-setup || echo "Couldn't find $(PYBIN)2.6"
56+ -@test -e "`which $(PYBIN)2.7`" && VERSION=2.7 make virtual-dir-setup || echo "Couldn't find $(PYBIN)2.7"
57+
58+
59+virtual-trial: VERSION ?= 2.7
60+virtual-trial:
61+ -. .venv-$(VERSION)/bin/activate && trial ./txaws
62+
63+
64+virtual-pep8: VERSION ?= 2.7
65+virtual-pep8:
66+ -. .venv-$(VERSION)/bin/activate && pep8 ./txaws
67+
68+
69+virtual-pyflakes: VERSION ?= 2.7
70+virtual-pyflakes:
71+ -. .venv-$(VERSION)/bin/activate && pyflakes ./txaws
72+
73+
74+virtual-check: VERSION ?= 2.7
75+virtual-check:
76+ -VERSION=$(VERSION) make virtual-trial
77+ -VERSION=$(VERSION) make virtual-pep8
78+ -VERSION=$(VERSION) make virtual-pyflakes
79+
80+
81+virtual-setup-build: VERSION ?= 2.7
82+virtual-setup-build:
83+ -@. .venv-$(VERSION)/bin/activate && python setup.py build
84+ -@. .venv-$(VERSION)/bin/activate && python setup.py sdist
85+
86+
87+virtual-setup-builds: VERSION ?= 2.7
88+virtual-setup-builds: virtual-builds
89+ -@test -e "`which python2.5`" && VERSION=2.5 make virtual-setup-build
90+ -@test -e "`which python2.6`" && VERSION=2.6 make virtual-setup-build
91+ -@test -e "`which python2.7`" && VERSION=2.7 make virtual-setup-build
92+
93+
94+virtual-checks: virtual-setup-builds
95+ -@test -e "`which python2.5`" && VERSION=2.5 make virtual-check
96+ -@test -e "`which python2.6`" && VERSION=2.6 make virtual-check
97+ -@test -e "`which python2.7`" && VERSION=2.7 make virtual-check
98+
99+
100+virtual-uninstall: VERSION ?= 2.7
101+virtual-uninstall: PACKAGE ?= ""
102+virtual-uninstall:
103+ -. .venv-$(VERSION)/bin/activate && pip uninstall $(PACKAGE)
104+
105+
106+virtual-uninstalls: PACKAGE ?= ""
107+virtual-uninstalls:
108+ -@test -e "`which python2.5`" && VERSION=2.5 PACKAGE=$(PACKAGE) make virtual-uninstall
109+ -@test -e "`which python2.6`" && VERSION=2.6 PACKAGE=$(PACKAGE) make virtual-uninstall
110+ -@test -e "`which python2.7`" && VERSION=2.7 PACKAGE=$(PACKAGE) make virtual-uninstall
111+
112+
113+virtual-dir-remove: VERSION ?= 2.7
114+virtual-dir-remove:
115+ rm -rfv .venv-$(VERSION)
116+
117+
118+clean-virtual-builds: clean
119+ @VERSION=2.5 make virtual-dir-remove
120+ @VERSION=2.6 make virtual-dir-remove
121+ @VERSION=2.7 make virtual-dir-remove
122+
123+
124+virtual-build-clean: clean-virtual-builds build virtual-builds
125+.PHONY: virtual-build-clean
126+
127+
128+check: MOD ?= txaws
129+check: build
130+ trial ./txaws
131+
132+
133+register:
134+ python setup.py register
135+
136+
137+upload: check build
138+ python setup.py sdist upload --show-response

Subscribers

People subscribed via source and target branches

to all changes: