Skip to content

Commit

Permalink
Add release information
Browse files Browse the repository at this point in the history
Reworked the dependencies.
  • Loading branch information
Patrick Valsecchi committed Feb 1, 2017
1 parent 5702fb2 commit 7f04557
Show file tree
Hide file tree
Showing 11 changed files with 54 additions and 45 deletions.
5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
/.venv/
/acceptance_tests/app/c2cwsgiutils/
/acceptance_tests/app/requirements.txt
/acceptance_tests/app/setup.cfg
/acceptance_tests/tests/c2cwsgiutils/
/acceptance_tests/app/c2cwsgiutils-0.0.0-py3-none-any.whl
/acceptance_tests/tests/setup.cfg
/acceptance_tests/tests/c2cwsgiutils-0.0.0-py3-none-any.whl
/build/
/c2cwsgiutils.egg-info/
/dist/
Expand Down
32 changes: 21 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@ all: lint acceptance
lint: lint_code lint_test_app lint_acceptance

.PHONY: lint_code
lint_code: build_test_app
docker run --rm $(DOCKER_BASE)_test_app:$(DOCKER_TAG) flake8 /app/c2cwsgiutils
lint_code: .venv/timestamp
.venv/bin/flake8 c2cwsgiutils

.PHONY: lint_test_app
lint_test_app: build_test_app
docker run --rm $(DOCKER_BASE)_test_app:$(DOCKER_TAG) flake8 /app/c2cwsgiutils_app
lint_test_app: .venv/timestamp
.venv/bin/flake8 acceptance_tests/app/c2cwsgiutils_app

.PHONY: lint_acceptance
lint_acceptance: build_acceptance
docker run --rm $(DOCKER_BASE)_acceptance:$(DOCKER_TAG) flake8 /acceptance_tests/tests
lint_acceptance: .venv/timestamp
.venv/bin/flake8 acceptance_tests/tests/tests

.PHONY: acceptance
acceptance: build_acceptance build_test_app
Expand All @@ -46,21 +46,31 @@ acceptance: build_acceptance build_test_app
exit $$status$$?

.PHONY: build_acceptance
build_acceptance:
rsync -a c2cwsgiutils setup.cfg acceptance_tests/tests/
build_acceptance: dist
cp dist/c2cwsgiutils-*-py3-none-any.whl acceptance_tests/tests/c2cwsgiutils-0.0.0-py3-none-any.whl
docker build --build-arg DOCKER_VERSION="$(DOCKER_VERSION)" --build-arg DOCKER_COMPOSE_VERSION="$(DOCKER_COMPOSE_VERSION)" -t $(DOCKER_BASE)_acceptance:$(DOCKER_TAG) acceptance_tests/tests

.PHONY: build_test_app
build_test_app:
rsync -a c2cwsgiutils requirements.txt setup.cfg acceptance_tests/app/
build_test_app: dist
cp dist/c2cwsgiutils-*-py3-none-any.whl acceptance_tests/app/c2cwsgiutils-0.0.0-py3-none-any.whl
cp setup.cfg acceptance_tests/app/
docker build -t $(DOCKER_BASE)_test_app:$(DOCKER_TAG) acceptance_tests/app

.venv/timestamp: requirements.txt acceptance_tests/tests/requirements.txt
/usr/bin/virtualenv --python=/usr/bin/python3.5 .venv
.venv/bin/pip install junit2html -r requirements.txt -r acceptance_tests/tests/requirements.txt
.venv/bin/pip install -r requirements.txt
touch $@

.PHONY: pull
pull:
for image in `find -name Dockerfile | xargs grep --no-filename FROM | awk '{print $$2}' | sort -u`; do docker pull $$image; done
for image in `find -name "docker-compose*.yml" | xargs grep --no-filename "image:" | awk '{print $$2}' | sort -u | grep -v $(DOCKER_BASE) | grep -v rancher`; do docker pull $$image; done

.PHONY: dist
dist: .venv/timestamp
rm -rf build dist
.venv/bin/python setup.py bdist_wheel

.PHONY: release
release: dist
.venv/bin/twine upload dist/*.whl
19 changes: 16 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ To see how to test such an application, look at
[acceptance_tests/tests](acceptance_tests/tests).


Build
-----
Developer info
--------------

You will need `docker` (>=1.12.0), `docker-compose` (>=1.10.0) and
You will need `docker` (>=1.12.0), `docker-compose` (>=1.10.0), twine and
`make` installed on the machine to play with this project.
Check available versions of `docker-engine` with
`apt-get policy docker-engine` and eventually force install the
Expand All @@ -38,3 +38,16 @@ To lint and test everything, run the following command:
```shell
make
```

Make sure you are strict with the version numbers:

* bug fix version change: Nothing added, removed or changed in the API and only bug fix
version number changes in the dependencies
* minor version change: The API must remain backward compatible and only minor version
number changes in the dependencies
* major version change: The API and the dependencies are not backward compatible

To make a release:

* Change the the version in [setup.py](setup.py)
* run `make release`
2 changes: 1 addition & 1 deletion acceptance_tests/app/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ MAINTAINER Camptocamp "info@camptocamp.com"
# after changing code

# Step #1 copy only the stuff needed to install the dependencies and run the script
COPY requirements.txt setup.py /app/
COPY requirements.txt setup.py c2cwsgiutils-0.0.0-py3-none-any.whl /app/
COPY .whiskey /app/.whiskey
RUN mod_wsgi-docker-build

Expand Down
2 changes: 2 additions & 0 deletions acceptance_tests/app/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
c2cwsgiutils-0.0.0-py3-none-any.whl
flake8==3.2.1
4 changes: 1 addition & 3 deletions acceptance_tests/app/test_app.iml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/c2cwsgiutils" />
</content>
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module" module-name="c2cwsgiutils" />
Expand Down
2 changes: 1 addition & 1 deletion acceptance_tests/tests/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ RUN curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE
chmod a+x /usr/bin/docker-compose

# Install python requirements
COPY requirements.txt ./requirements.txt
COPY requirements.txt c2cwsgiutils-0.0.0-py3-none-any.whl ./
RUN pip install -r ./requirements.txt

COPY . ./
Expand Down
4 changes: 1 addition & 3 deletions acceptance_tests/tests/acceptance.iml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/c2cwsgiutils" />
</content>
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module" module-name="c2cwsgiutils" />
Expand Down
5 changes: 1 addition & 4 deletions acceptance_tests/tests/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
c2cwsgiutils-0.0.0-py3-none-any.whl
flake8==3.2.1
netifaces==0.10.5
psycopg2==2.6.2
pytest==3.0.5
requests==2.12.5
12 changes: 2 additions & 10 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
cee_syslog_handler==0.3.4
cornice==2.3.0
flake8==3.2.1
netifaces==0.10.5
psycopg2==2.6.2
pyramid==1.7.3
pyramid_tm==1.1.1
SQLAlchemy==1.1.5
zope.interface==4.3.3
zope.sqlalchemy==0.7.7

junit2html
twine
12 changes: 6 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from setuptools import setup, find_packages


version = '0.0.1'
version = '0.0.2'

setup(
name='c2cwsgiutils',
Expand All @@ -13,9 +13,6 @@
"Environment :: Plugins",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3.3",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Intended Audience :: Information Technology",
"License :: OSI Approved :: MIT License",
Expand All @@ -24,17 +21,20 @@
keywords='geo gis sqlalchemy orm wsgi',
author='Camptocamp',
author_email='info@camptocamp.com',
url='http://camptocamp.com/',
url='https://github.com/camptocamp/c2cwsgiutils',
license='MIT',
packages=find_packages(exclude=['ez_setup', 'acceptance_tests', 'tests', 'doc']),
include_package_data=True,
zip_safe=False,
install_requires=[
'cee_syslog_handler==0.3.4',
'cornice==2.4.0',
'netifaces==0.10.5',
'psycopg2==2.6.2',
'pyramid==1.7.3',
'pyramid==1.8.1',
'pyramid_tm==1.1.1',
'pytest==3.0.6',
'requests==2.13.0',
'SQLAlchemy==1.1.5',
'zope.interface==4.3.3',
'zope.sqlalchemy==0.7.7',
Expand Down

0 comments on commit 7f04557

Please sign in to comment.