diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000000000000000000000000000000000000..f5c89b529011795a395299e8de293fe818050159 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,33 @@ +# EditorConfig is awesome: https://EditorConfig.org + +# top-most EditorConfig file +root = true + +# Unix-style newlines with a newline ending every file +[*] +end_of_line = lf +insert_final_newline = true + +# Matches multiple files with brace expansion notation +# Set default charset +[*.{js,py}] +charset = utf-8 + +# 4 space indentation +[*.py] +indent_style = space +indent_size = 4 + +# Tab indentation (no size specified) +[Makefile] +indent_style = tab + +# Indentation override for all JS under lib directory +[lib/**.js] +indent_style = space +indent_size = 2 + +# Matches the exact files either package.json or .travis.yml +[{package.json,.travis.yml}] +indent_style = space +indent_size = 2 diff --git a/.travis.yaml b/.travis.yaml new file mode 100644 index 0000000000000000000000000000000000000000..78d93d00957f0ed4ad9576b1d2d4fecd1980f22a --- /dev/null +++ b/.travis.yaml @@ -0,0 +1,14 @@ +language: python + +python: "3.11" + +install: + - pip install -r requirements.txt + - pip install coveralls + +script: + - pytest -p no:warnings + - coverage run -m pytest -p no:warnings + +after_script: + - coveralls diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000000000000000000000000000000000000..35056f77082d5c1ae505e9881e487ef1f61fcc9f --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,6 @@ +# elp ChangeLog + +All notable changes to this project will be documented in this file. + +## [0.1.0] - 2023-10-31 +- [x] 第一个版本 diff --git a/Makefile b/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..97c71f33b18f6a8ead4c243cf878208f5fd5ca47 --- /dev/null +++ b/Makefile @@ -0,0 +1,39 @@ +.PHONY: init init-migration build run db-migrate test tox + +init: build run + docker-compose exec web flask db init + docker-compose exec web flask db migrate + docker-compose exec web flask db upgrade + docker-compose exec web flask init + @echo "Init done, containers running" + +build: + docker-compose build + +run: + @mkdir -p db + docker-compose up -d + +db-init: + docker-compose exec web flask db init + +db-migrate: + docker-compose exec web flask db migrate + +db-upgrade: + docker-compose exec web flask db upgrade + +test: + docker-compose stop celery # stop celery to avoid conflicts with celery tests + docker-compose start rabbitmq redis # ensuring both redis and rabbitmq are started + docker-compose run -v $(PWD)/tests:/code/tests:ro web tox -e test + docker-compose start celery + +tox: + docker-compose stop celery # stop celery to avoid conflicts with celery tests + docker-compose start rabbitmq redis # ensuring both redis and rabbitmq are started + docker-compose run -v $(PWD)/tests:/code/tests:ro web tox -e y + docker-compose start celery + +lint: + docker-compose run web tox -e lint