Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Project boilerplate #3
Conversation
mitechie
reviewed
Aug 17, 2015
| +flake8==2.4.1 | ||
| +mccabe==0.3.1 | ||
| +mock==1.3.0 | ||
| +nose==1.3.7 |
mitechie
Aug 17, 2015
Collaborator
we shouldn't need nose and pytest. I think talking with @markramm the thought is to stick to pytest.
markramm
Aug 17, 2015
Owner
I think just using pytest should be enough -- is there something in Nose that we need?
mitechie
reviewed
Aug 17, 2015
| + $(PIP) install -r requirements.txt | ||
| + | ||
| +# Nose is our test requirements canary | ||
| +$(NOSETESTS): $(PYTHON) deps |
bac
Aug 17, 2015
Regarding @mitechie's comment earlier, since deps is a phony (not a real target on the file system with a timestamp), running these tests will cause the deps target to fire every time.
So deps and test-deps should probably have canary files. Something like:
https://pastebin.canonical.com/137717/
The goal is that invoking a makefile target more than once results in nothing being done on subsequent tries. If you run 'make deps' repeatedly now you'll see it invokes pip install each time. And it'll do it every time you try to run tests.
|
@markramm @howbazaar can you do a second review of this please? I've asked Huw to look at some project skeleton work to make sure it can be built into a python package and that there's the bones to hang common tools like test running, linting, etc off of. |
mitechie
reviewed
Aug 17, 2015
| +# DEPENDENCIES | ||
| +############## | ||
| +.PHONY: test-deps | ||
| +test-deps: $(PIP) |
mitechie
Aug 17, 2015
Collaborator
check with @bac as I think his trick with working with deps files has been a great way to speed things up. His rework on our own storefront app has implemented this for comparison.
bac
Aug 17, 2015
This should probably depend on a canary file and on test-requirements.txt. After the install be sure to touch the canary.
mitechie
reviewed
Aug 17, 2015
| +.PHONY: check | ||
| +check: clean-all lint test | ||
| + | ||
| +############### |
mitechie
Aug 17, 2015
Collaborator
there should also be a releases section that will build the pypi release and we should also generate a wheel as we do on other things.
mitechie
reviewed
Aug 17, 2015
| + | ||
| +setup( | ||
| + name='jujulib', | ||
| + version='0.1.0', |
|
Thanks @huwshimi, a few other requests/changes please. |
|
+1 with Rick's changes. |
bac
reviewed
Aug 17, 2015
| + $(PIP) install -r test-requirements.txt | ||
| + | ||
| +.PHONY: deps | ||
| +deps: $(PIP) |
bac
Aug 17, 2015
Likewise add requirements.txt to this dependency so the deps will get regenerated when that file changes.
bac
reviewed
Aug 17, 2015
| +$(NOSETESTS): $(PYTHON) deps | ||
| + $(MAKE) test-deps | ||
| + | ||
| +$(FLAKE8): $(NOSETESTS) |
bac
reviewed
Aug 17, 2015
| +ENV := env/ | ||
| +BIN := $(ENV)bin/ | ||
| +FLAKE8 := $(BIN)flake8 | ||
| +NOSETESTS := $(BIN)nosetests |
bac
Aug 17, 2015
It's trivial, but it is just weird having the trailing slash in the BIN definition because this now looks funny.
bac
reviewed
Aug 17, 2015
| + | ||
| +# Nose is our test requirements canary | ||
| +$(NOSETESTS): $(PYTHON) deps | ||
| + $(MAKE) test-deps |
bac
Aug 17, 2015
This target is not correct as it just just runs 'make test-deps' which is already a dependency.
bac
commented
Aug 17, 2015
|
Thanks for this branch @huwshimi. I got kind of carried away looking at the Makefile to ensure I wasn't telling you something dumb. Here is a version that I think is pretty good: https://pastebin.canonical.com/137718/ With these and @mitechie's suggestions |
huwshimi
added some commits
Aug 14, 2015
|
I have made these changes with the exception of "there should also be a releases section that will build the pypi release and we should also generate a wheel as we do on other things." which I am doing in a follow up branch so as to not make this too big. |
bac
reviewed
Aug 18, 2015
| + | ||
| +.PHONY: clean-env | ||
| +clean-env: | ||
| + rm -rf $(ENV) |
bac
commented
Aug 18, 2015
|
|
|
|
huwshimi commentedAug 14, 2015
Here is a bunch of project setup stuff. Added setup.py, Makefile, requirements, lint etc.