Skip to content

Commit

Permalink
Merge branch 'release/8.2.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
johnbywater committed May 16, 2020
2 parents a2d8a7f + ba3d4db commit 152c748
Show file tree
Hide file tree
Showing 122 changed files with 1,273 additions and 630 deletions.
73 changes: 73 additions & 0 deletions .dockerignore
@@ -0,0 +1,73 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]

# C extensions
*.so

# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.coveragerc
.cache
nosetests.xml
coverage.xml
*,cover

# Translations
*.mo
*.pot

# Django stuff:
*.log

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Other ignores
.github/
.idea/
.mypy_cache/
.pytest_cache/
.editorconfig
.env
.travis.yml
AUTHORS
CODE_OF_CONDUCT.md
dev
eventsourcing/tests/djangoproject/db.sqlite3
README.md
README_example_with_axon.md
3 changes: 3 additions & 0 deletions .editorconfig
Expand Up @@ -39,3 +39,6 @@ indent_style = tab
# Batch files use tabs for indentation
[*.bat]
indent_style = tab

[*.{yml, yaml}]
indent_size = 2
16 changes: 16 additions & 0 deletions .env
@@ -0,0 +1,16 @@
COMPOSE_FILE=dev/docker-compose.yaml
COMPOSE_PROJECT_NAME=eventsourcing

CASSANDRA_HOSTS=127.0.0.1

MYSQL_HOST=127.0.0.1
MYSQL_DATABASE=eventsourcing
MYSQL_PASSWORD=eventsourcing
MYSQL_ROOT_PASSWORD=eventsourcing_root
MYSQL_USER=eventsourcing

POSTGRES_HOST=127.0.0.1
POSTGRES_PASSWORD=eventsourcing
POSTGRES_USER=eventsourcing

REDIS_HOST=127.0.0.1
5 changes: 5 additions & 0 deletions .git-blame-ignore-revs
@@ -0,0 +1,5 @@
# applied imports sorting and black formatting
1190c2fe4cf3f9b233b61f8f9a857c1007d11345
6f5bf49327b66055f1ff865285543d070856c602
53cfd70288051457999074479ddbfbaecb052f10
6d9ec698a6310b701ffbcdf987ff5a3675f6e943
8 changes: 4 additions & 4 deletions .readthedocs.yml
@@ -1,5 +1,5 @@
python:
version: 3
pip_install: true
extra_requirements:
- docs
version: 3
pip_install: true
extra_requirements:
- docs
22 changes: 10 additions & 12 deletions .travis.yml
Expand Up @@ -20,9 +20,9 @@ before_install:
- sudo apt-get -qq update
- sudo apt-get install -y openjdk-8-jdk
- sudo apt-get install -y icedtea-8-plugin
# - sudo update-java-alternatives --set /usr/lib/jvm/java-1.8.0-openjdk-amd64
# - sudo update-java-alternatives --set /usr/lib/jvm/java-1.8.0-openjdk-amd64
- sudo update-java-alternatives -v --set java-1.8.0-openjdk-amd64
# - source /etc/environment
# - source /etc/environment
- export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-amd64
- java -version

Expand Down Expand Up @@ -56,28 +56,26 @@ install:
- python --version
- pip install -U pip wheel
- CASS_DRIVER_NO_CYTHON=1 pip install -e .[testing]
- pip install pymysql
- pip install mysql-connector-python-rf
- pip install python-coveralls
- pip install -U "coverage<5.0.0" # v5 is incompatible ATM.

env:
global:
- CASSANDRA_HOSTS=127.0.0.1
- MYSQL_USER=travis
- MYSQL_PASSWORD=
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=

script:
- if [[ $TRAVIS_PYTHON_VERSION != pypy* ]]; then
- if [[ $TRAVIS_PYTHON_VERSION != pypy* ]]; then
coverage run --concurrency=multiprocessing -m unittest discover eventsourcing.tests -v;
fi
fi

- if [[ $TRAVIS_PYTHON_VERSION == pypy* ]]; then
- if [[ $TRAVIS_PYTHON_VERSION == pypy* ]]; then
python -m unittest discover eventsourcing.tests -v;
fi
fi

after_success:
- if [[ $TRAVIS_PYTHON_VERSION != pypy* ]]; then
- if [[ $TRAVIS_PYTHON_VERSION != pypy* ]]; then
coverage combine;
coveralls;
fi
fi
2 changes: 1 addition & 1 deletion LICENSE
@@ -1,6 +1,6 @@
BSD 3-Clause License

Copyright (c) 2018, John Bywater
Copyright (c) 2020, John Bywater
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
124 changes: 124 additions & 0 deletions Makefile
@@ -0,0 +1,124 @@
.EXPORT_ALL_VARIABLES:
DOTENV_FILE ?= .env

-include $(DOTENV_FILE)

.PHONY: install
install:
CASS_DRIVER_NO_CYTHON=1
@pip install -e ".[cassandra,sqlalchemy,axonserver,axon,ray,django,testing,dev,docs]"

.PHONY: docker-pull
docker-pull:
@docker-compose pull

.PHONY: docker-build
docker-build:
@docker-compose build

.PHONY: docker-up
docker-up:
@docker-compose up -d
@docker-compose ps

.PHONY: docker-stop
docker-stop:
@docker-compose stop

.PHONY: docker-down
docker-down:
@docker-compose down -v --remove-orphans


.PHONY: docker-logs
docker-logs:
@docker-compose logs --follow --tail=1000


.PHONY: lint-black
lint-black:
@black --check --diff .

.PHONY: lint-flake8
lint-flake8:
@flake8 eventsourcing

.PHONY: lint-isort
lint-isort:
@isort --check-only --diff --recursive .

.PHONY: lint-mypy
lint-mypy:
@mypy --ignore-missing-imports eventsourcing

.PHONY: lint-dockerfile
lint-dockerfile:
@docker run --rm -i replicated/dockerfilelint:ad65813 < ./dev/Dockerfile_eventsourcing_requirements

.PHONY: lint
lint: lint-black lint-flake8 lint-isort lint-mypy lint-dockerfile


.PHONY: fmt-isort
fmt-isort:
@isort -y --recursive .

.PHONY: fmt-black
fmt-black:
@black .

.PHONY: fmt
fmt: fmt-black fmt-isort


.PHONY: test
test:
@coverage run \
--concurrency=multiprocessing \
-m unittest discover \
eventsourcing.tests -vv --failfast
@coverage combine
@coverage report
@coverage html


.PHONY: quick-test
quick-test:
QUICK_TESTS_ONLY=1 python -m unittest discover eventsourcing.tests -vv


.PHONY: docs
docs:
cd docs && make html


.PHONY: brew-services-start
brew-services-start:
brew services start mysql
brew services start postgresql
brew services start redis
~/axonserver/axonserver.jar &
cassandra -f &


.PHONY: brew-services-stop
brew-services-stop:
brew services stop mysql
brew services stop postgresql
brew services stop redis
pkill -15 java


.PHONY: prepare-distribution
prepare-distribution:
python ./dev/prepare-distribution.py


.PHONY: release-distribution
release-distribution:
python ./dev/release-distribution.py


.PHONY: test-distribution
test-distribution:
python ./dev/test-released-distribution.py
2 changes: 1 addition & 1 deletion README_example_with_axon.md
Expand Up @@ -117,7 +117,7 @@ import os
os.environ['CIPHER_KEY'] = cipher_key

# AxonServer database connection string.
os.environ['DB_URI'] = "localhost:8124"
os.environ['DB_URI'] = "{}:8124".format(os.environ.get('AXON_HOST', 'localhost'))
```

Run the code. Construct application and use as context manager.
Expand Down
1 change: 1 addition & 0 deletions dev/.env
5 changes: 0 additions & 5 deletions dev/Dockerfile_eventsourcing_requirements
@@ -1,8 +1,3 @@
# To use this Docker file in PyCharm, just add a new Docker project interpreter,
# and set an image name such as "eventsourcing_requirements:latest". It will
# take a little while to download and build everything, but then tests which
# do not depend on other services such as MySQL and Cassandra should pass.
# To run containers needed to pass the full test suite, see docker-compose.yaml.
FROM python:3.7

WORKDIR /app
Expand Down
52 changes: 52 additions & 0 deletions dev/MACOS_SETUP_NOTES.md
@@ -0,0 +1,52 @@
This document describes how to setup MacOS with databases needed to run the test suite:

- MySQL
- PostgreSQL
- Redis
- Cassandra
- Axon Server


To setup MySQL:

$ brew install mysql
$ brew services start mysql
$ mysql -u root
mysql> CREATE DATABASE EVENTSOURCING;
mysql> CREATE USER 'eventsourcing'@'localhost' IDENTIFIED BY 'eventsourcing';
mysql> GRANT ALL PRIVILEGES ON eventsourcing.* TO 'eventsourcing'@'localhost';

To setup PostgreSQL:

$ brew install postgresql
$ brew services start postgresql


To setup Redis:

$ brew install redis
$ brew services start redis


To setup Cassandra:

$ brew install cassandra
$ brew services start cassandra

If that doesn't actually start Cassandra, then try this in a terminal:
$ cassandra -f


To setup Axon:
$ ./dev/download_axon_server.sh
$ ./axonserver/axonserver.jar


After this, the databases can be stopped with:

$ make brew-services-stop


The database can be started with:

$ make brew-services-start
5 changes: 3 additions & 2 deletions dev/RELEASE_SCRIPT.md
Expand Up @@ -8,15 +8,16 @@ Steps to make a new release.
1. Push branch to GitHub and start a PR to master.
1. Review versions of all dependencies.
1. Update release notes to describe what's new in this release.
1. Run 'prepare-distribution' script.
1. Update copyright year in LICENSE file.
1. Run 'make prepare-distribution'.
1. Increase version number to 'rc1', 'rc2' in case of failure.
1. Try to fix and push changes to GitHub.
1. Make changes until built distribution is working.
1. When all tests passing, increase version number to release version (edit and commit).
1. Finish release (merge into master and develop). Tag master 'vX.Y.Z'.
1. Push all changes to GitHub.
1. Checkout master branch (at the tag).
1. Run './dev/release-distribution' script (from project root directory).
1. Run 'make release-distribution'.
1. Run './dev/test-released-distribution' script (from project root directory).
1. Manually check documentation has been built and installed.
1. Manually check PyPI.
Expand Down

0 comments on commit 152c748

Please sign in to comment.