-
Notifications
You must be signed in to change notification settings - Fork 0
Make individual modules into separate packages #11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: split_ready_pre
Are you sure you want to change the base?
Changes from all commits
b9b7708
14d044f
687b2c8
02c7197
13c4d27
5ea1d61
0a9d49b
143c492
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| [run] | ||
| branch = True | ||
| source = stor, stor_dx, stor_s3, stor_swift | ||
| omit = stor/stor/tests/test_posix_path_compat.py,stor/stor/tests/test_integration.py,stor/stor/third_party/backoff.py,stor_dx/stor_dx/tests/test_integration_dx.py,stor_s3/stor_s3/tests/test_integration_s3.py,stor_swift/stor_swift/tests/test_integration_swift.py | ||
|
|
||
| [report] | ||
| exclude_lines = | ||
| # Have to re-enable the standard pragma | ||
| pragma: no cover | ||
| raise NotImplementedError | ||
| show_missing=1 | ||
| fail_under=100 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| # Makefile utilities for running tests and publishing the package | ||
|
|
||
| PACKAGE_NAME=stor | ||
| PACKAGE_NAMES:=stor/ stor_dx/ stor_swift/ stor_s3/ | ||
| TEST_OUTPUT?=nosetests.xml | ||
| PIP_INDEX_URL=https://pypi.python.org/simple/ | ||
| PYTHON?=$(shell which python) | ||
|
|
@@ -13,7 +13,7 @@ endif | |
|
|
||
| .PHONY: default | ||
| default: | ||
| python setup.py check build | ||
| cd stor; python setup.py check build; cd .. | ||
|
|
||
| VENV_DIR?=.venv | ||
| VENV_ACTIVATE=$(VENV_DIR)/bin/activate | ||
|
|
@@ -23,42 +23,42 @@ WITH_PBR=$(WITH_VENV) PBR_REQUIREMENTS_FILES=requirements-pbr.txt | |
| .PHONY: venv | ||
| venv: $(VENV_ACTIVATE) | ||
|
|
||
| $(VENV_ACTIVATE): requirements*.txt | ||
| $(VENV_ACTIVATE): stor*/requirements*.txt | ||
| test -f $@ || virtualenv --python=$(PYTHON) $(VENV_DIR) | ||
| $(WITH_VENV) echo "Within venv, running $$(python --version)" | ||
| $(WITH_VENV) pip install -r requirements-setup.txt --index-url=${PIP_INDEX_URL} | ||
| $(WITH_VENV) pip install -e . --index-url=${PIP_INDEX_URL} | ||
| $(WITH_VENV) pip install -r requirements-dev.txt --index-url=${PIP_INDEX_URL} | ||
| $(WITH_VENV) pip install -r requirements-docs.txt --index-url=${PIP_INDEX_URL} | ||
| $(WITH_VENV) pip install -r stor/requirements-setup.txt --index-url=${PIP_INDEX_URL} | ||
| $(WITH_VENV) ./run_all.sh 'pip install -e . --index-url=${PIP_INDEX_URL}' $(PACKAGE_NAMES) | ||
| $(WITH_VENV) pip install -r stor/requirements-dev.txt --index-url=${PIP_INDEX_URL} | ||
| $(WITH_VENV) pip install -r stor/requirements-docs.txt --index-url=${PIP_INDEX_URL} | ||
| touch $@ | ||
|
|
||
| develop: venv | ||
| $(WITH_VENV) python setup.py develop | ||
| $(WITH_VENV) ./run_all.sh 'python setup.py develop' $(PACKAGE_NAMES) | ||
|
|
||
| .PHONY: docs | ||
| docs: venv clean-docs | ||
| $(WITH_VENV) cd docs && make html | ||
|
|
||
|
|
||
| .PHONY: setup | ||
| setup: ##[setup] Run an arbitrary setup.py command | ||
| setup: venv | ||
| ifdef ARGS | ||
| $(WITH_PBR) python setup.py ${ARGS} | ||
| $(WITH_PBR) ./run_all.sh 'python setup.py ${ARGS}' $(PACKAGE_NAMES) | ||
| else | ||
| @echo "Won't run 'python setup.py ${ARGS}' without ARGS set." | ||
| endif | ||
|
|
||
| .PHONY: clean | ||
| clean: | ||
| $(PYTHON) setup.py clean | ||
| rm -rf build/ | ||
| rm -rf dist/ | ||
| rm -rf *.egg*/ | ||
| rm -rf __pycache__/ | ||
| ./run_all.sh '$(PYTHON) setup.py clean' $(PACKAGE_NAMES) | ||
| ./run_all.sh 'rm -rf *.egg*/' $(PACKAGE_NAMES) . | ||
| ./run_all.sh 'rm -rf dist/' $(PACKAGE_NAMES) | ||
| ./run_all.sh 'rm -rf build/' $(PACKAGE_NAMES) | ||
| ./run_all.sh 'rm -rf __pycache__/' $(PACKAGE_NAMES) . | ||
| ./run_all.sh 'rm -rf .*cache/' $(PACKAGE_NAMES) . | ||
| rm -f MANIFEST | ||
| rm -f $(TEST_OUTPUT) | ||
| find $(PACKAGE_NAME) -type f -name '*.pyc' -delete | ||
| ./run_all.sh 'find . -type f -name '*.pyc' -delete' $(PACKAGE_NAMES) . | ||
| rm -rf nosetests* "${TEST_OUTPUT}" coverage .coverage | ||
|
|
||
|
|
||
|
|
@@ -73,7 +73,7 @@ teardown: | |
|
|
||
| .PHONY: lint | ||
| lint: venv | ||
| $(WITH_VENV) flake8 $(PACKAGE_NAME)/ | ||
| $(WITH_VENV) flake8 $(PACKAGE_NAMES) | ||
|
|
||
| .PHONY: unit-test | ||
| unit-test: venv | ||
|
|
@@ -99,14 +99,15 @@ endif | |
| .PHONY: travis-test | ||
| travis-test: venv | ||
| $(WITH_VENV) \ | ||
| coverage erase; \ | ||
| coverage run setup.py test; \ | ||
| ./run_all.sh 'coverage erase' $(PACKAGE_NAMES) .; \ | ||
| ./run_all.sh 'coverage run setup.py test' $(PACKAGE_NAMES); \ | ||
| coverage combine stor*/.coverage; \ | ||
| status=$$?; \ | ||
| coverage report && exit $$status; | ||
|
|
||
| # Distribution | ||
|
|
||
| VERSION=$(shell $(WITH_PBR) python setup.py --version | sed 's/\([0-9]*\.[0-9]*\.[0-9]*\).*$$/\1/') | ||
| VERSION=$(shell $(WITH_PBR) cd stor; python setup.py --version | sed 's/\([0-9]*\.[0-9]*\.[0-9]*\).*$$/\1/'; cd ..) | ||
|
|
||
| .PHONY: tag | ||
| tag: ##[distribution] Tag the release. | ||
|
|
@@ -117,7 +118,7 @@ tag: venv | |
|
|
||
| .PHONY: dist | ||
| dist: venv fullname | ||
| $(WITH_VENV) python setup.py sdist | ||
| $(WITH_VENV) ./run_all.sh 'python setup.py sdist' $(PACKAGE_NAMES) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think our packaging systems need all of these to remain in the parent |
||
|
|
||
| .PHONY: publish-docs | ||
| publish-docs: | ||
|
|
@@ -133,4 +134,4 @@ version: | |
|
|
||
| .PHONY: fullname | ||
| fullname: | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. you prob only need this once for main repo, since names will stay all the same |
||
| $(PYTHON) setup.py --fullname | ||
| ./run_all.sh '$(PYTHON) setup.py --fullname' $(PACKAGE_NAMES) | ||
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| CMD=$1 | ||
| shift | ||
| DIRS=$* | ||
| for directory in $DIRS; do | ||
| cd $directory; ${CMD}; cd .. | ||
| done |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +0,0 @@ | ||
| from setuptools import setup | ||
|
|
||
| setup( | ||
| pbr=True, | ||
| setup_requires=['pbr'], | ||
| ) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| # have to explicitly ban certain requests versions to match keystoneauth1 package for swift | ||
| requests!=2.12.2,!=2.13.0,>=2.10.0 | ||
| six | ||
| python-swiftclient |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| from setuptools import setup | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this one may need to have an |
||
|
|
||
| setup( | ||
| pbr=True, | ||
| setup_requires=['pbr'], | ||
| ) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -67,6 +67,9 @@ def __init__(self, pth): | |
| can be any of s3 or swift. | ||
| The ``(drive)://`` prefix is required in the path. | ||
| """ | ||
| if hasattr(self, 'path_converted') and self.path_converted \ | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why did this sneak in here? |
||
| and hasattr(self, 'new_path'): # pragma: no cover | ||
| pth = self.new_path | ||
| if not hasattr(pth, 'startswith') or not pth.startswith(self.drive): | ||
| raise ValueError('path must have %s (got %r)' % (self.drive, pth)) | ||
| return super(OBSPath, self).__init__(pth) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| cached-property | ||
| contextlib2 | ||
| dxpy>=0.265.0; python_version <= '2.7' | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. note: remember this needs to just be dxpy |
||
| dxpy3; python_version > '3.0' | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's call
./run_all.sh./within_each_folder_run.shinstead.One point here (that is optional, but potentially nice way to learn Makefile-isms), would be that you could write this like we do for MSM:
etc
Might be a little clearer to read and would not require second shell script.
Can also use
patsubstto make it a little cleaner.Totally optional to do so - but if you want excuse to understand makefiles a bit better could be good.