Skip to content
Snippets Groups Projects
Unverified Commit f2fa06c2 authored by Andrea Franchini's avatar Andrea Franchini
Browse files

move from poetry to pip + venv to simplify CI/CD

parent a3bd06de
No related branches found
No related tags found
No related merge requests found
*~
*__pycache__*
.vscode
docs/_build
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST
# 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/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/
# Translations
*.mo
*.pot
# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal
# Flask stuff:
instance/
.webassets-cache
# Scrapy stuff:
.scrapy
# Sphinx documentation
docs/_build/
# PyBuilder
.pybuilder/
target/
# Jupyter Notebook
.ipynb_checkpoints
# IPython
profile_default/
ipython_config.py
# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version
# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock
# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock
# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/#use-with-ide
.pdm.toml
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/
# Celery stuff
celerybeat-schedule
celerybeat.pid
# SageMath parsed files
*.sage.py
# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/
# Spyder project settings
.spyderproject
.spyproject
# Rope project settings
.ropeproject
# mkdocs documentation
/site
# mypy
.mypy_cache/
.dmypy.json
dmypy.json
# Pyre type checker
.pyre/
# pytype static type analyzer
.pytype/
# Cython debug symbols
cython_debug/
# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
\ No newline at end of file
......@@ -80,7 +80,7 @@ run-functional-tests:
# Thus, we need to override the command so that the server is run on port 8080.
- docker run --name $TESTS_CONTAINER_NAME -d -e "UVICORN_PORT=8080" $TMP_IMAGE
# Install everything required for the tests.
- docker exec -i $TESTS_CONTAINER_NAME /bin/bash -c "pip install -r dev-requirements.txt"
- docker exec -i $TESTS_CONTAINER_NAME /bin/bash -c "pip install -r requirements.txt"
# Run the tests.
- docker exec -i $TESTS_CONTAINER_NAME /bin/bash -c "python -m pytest"
# Stop the tests container.
......
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python: MC Synthesis",
"type": "python",
"request": "launch",
"module": "mc_openapi",
"justMyCode": true,
"args": [
"-d", "tests/doml/openstack_template.domlx",
"--synth"
]
}
]
}
\ No newline at end of file
{
"python.testing.pytestArgs": [
"tests"
],
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true
}
\ No newline at end of file
# PIACERE Model Checker
> **You can read the [docs here](https://andreafranchini.com/piacere-model-checker/) for more details.**
_______________________
## **You can read the [docs here](https://andreafranchini.com/piacere-model-checker/) for more details.**
_______________________
The DOML Model Checker is a component of the [PIACERE](https://www.piacere-project.eu/) framework
in charge of checking the correctness and consistency of
[DOML](https://www.piacere-doml.deib.polimi.it/) models.
This project is packaged with [Poetry](https://python-poetry.org/).
## Build and Run
We provide a `requirements.txt` file for CI/CD purposes.
If you add a new package, regenerate it by running:
Build with
```sh
poetry install
poetry run pip freeze > requirements.txt
```
then run with
## Setup
Activate the Python Virtual Environment with:
```sh
poetry run python -m mc_openapi
source .venv/bin/activate
```
Run tests with:
Install the required packages with:
```sh
poetry run python -m pytest
pip install -r requirements.txt
```
## Run the model checker web server
```sh
python -m mc_openapi
```
## Run with Uvicorn
......@@ -31,6 +38,12 @@ The project may be run with [Uvicorn](https://www.uvicorn.org/) as follows:
```sh
uvicorn --port 8080 --host 0.0.0.0 --interface wsgi --workers 2 mc_openapi.app_config:app
```
## Run tests
Run tests with:
```sh
python -m pytest
```
## Run with Docker
......@@ -53,11 +66,7 @@ by adding `-p 127.0.0.1:8080:80/tcp` to the `docker run` command.
The documentation has been written in [Sphinx](https://www.sphinx-doc.org/)
and covers both usage through the PIACERE IDE and the REST APIs.
To build it, type
```sh
poetry shell
```
and then
Build the documentation with:
```sh
cd docs
make html
......
alabaster==0.7.12 ; python_version >= "3.9" and python_version < "4.0"
anyio==3.6.1 ; python_version >= "3.9" and python_version < "4.0"
appnope==0.1.3 ; python_version >= "3.9" and python_version < "4.0" and platform_system == "Darwin" or python_version >= "3.9" and python_version < "4.0" and sys_platform == "darwin"
asttokens==2.0.8 ; python_version >= "3.9" and python_version < "4.0"
attrs==22.1.0 ; python_version >= "3.9" and python_version < "4.0"
babel==2.10.3 ; python_version >= "3.9" and python_version < "4.0"
backcall==0.2.0 ; python_version >= "3.9" and python_version < "4.0"
certifi==2022.9.24 ; python_version >= "3.9" and python_version < "4"
cffi==1.15.1 ; python_version >= "3.9" and python_version < "4.0" and implementation_name == "pypy"
charset-normalizer==2.1.1 ; python_version >= "3.9" and python_version < "4"
click==8.1.3 ; python_version >= "3.9" and python_version < "4.0"
clickclick==20.10.2 ; python_version >= "3.9" and python_version < "4.0"
colorama==0.4.5 ; python_version >= "3.9" and python_version < "4.0" and sys_platform == "win32" or python_version >= "3.9" and python_version < "4.0" and platform_system == "Windows"
colorful==0.5.4 ; python_version >= "3.9" and python_version < "4.0"
connexion[swagger-ui]==2.14.1 ; python_version >= "3.9" and python_version < "4.0"
debugpy==1.6.3 ; python_version >= "3.9" and python_version < "4.0"
decorator==5.1.1 ; python_version >= "3.9" and python_version < "4.0"
docutils==0.17.1 ; python_version >= "3.9" and python_version < "4.0"
entrypoints==0.4 ; python_version >= "3.9" and python_version < "4.0"
executing==1.1.0 ; python_version >= "3.9" and python_version < "4.0"
flask==2.2.2 ; python_version >= "3.9" and python_version < "4.0"
future-fstrings==1.2.0 ; python_version >= "3.9" and python_version < "4.0"
h11==0.14.0 ; python_version >= "3.9" and python_version < "4.0"
httptools==0.5.0 ; python_version >= "3.9" and python_version < "4.0"
idna==3.4 ; python_version >= "3.9" and python_version < "4"
imagesize==1.4.1 ; python_version >= "3.9" and python_version < "4.0"
importlib-metadata==5.0.0 ; python_version >= "3.9" and python_version < "3.10"
inflection==0.5.1 ; python_version >= "3.9" and python_version < "4.0"
iniconfig==1.1.1 ; python_version >= "3.9" and python_version < "4.0"
ipykernel==6.16.0 ; python_version >= "3.9" and python_version < "4.0"
ipython==8.5.0 ; python_version >= "3.9" and python_version < "4.0"
itsdangerous==2.1.2 ; python_version >= "3.9" and python_version < "4.0"
jedi==0.18.1 ; python_version >= "3.9" and python_version < "4.0"
jinja2==3.1.2 ; python_version >= "3.9" and python_version < "4.0"
joblib==1.2.0 ; python_version >= "3.9" and python_version < "4.0"
jsonschema==4.16.0 ; python_version >= "3.9" and python_version < "4.0"
jupyter-client==7.3.5 ; python_version >= "3.9" and python_version < "4.0"
jupyter-core==4.11.1 ; python_version >= "3.9" and python_version < "4.0"
lxml==4.9.1 ; python_version >= "3.9" and python_version < "4.0"
markupsafe==2.1.1 ; python_version >= "3.9" and python_version < "4.0"
matplotlib-inline==0.1.6 ; python_version >= "3.9" and python_version < "4.0"
nest-asyncio==1.5.6 ; python_version >= "3.9" and python_version < "4.0"
networkx==2.8.7 ; python_version >= "3.9" and python_version < "4.0"
ordered-set==4.1.0 ; python_version >= "3.9" and python_version < "4.0"
packaging==21.3 ; python_version >= "3.9" and python_version < "4.0"
parso==0.8.3 ; python_version >= "3.9" and python_version < "4.0"
pexpect==4.8.0 ; python_version >= "3.9" and python_version < "4.0" and sys_platform != "win32"
pickleshare==0.7.5 ; python_version >= "3.9" and python_version < "4.0"
pluggy==1.0.0 ; python_version >= "3.9" and python_version < "4.0"
prettyprinter==0.18.0 ; python_version >= "3.9" and python_version < "4.0"
prompt-toolkit==3.0.31 ; python_version >= "3.9" and python_version < "4.0"
psutil==5.9.2 ; python_version >= "3.9" and python_version < "4.0"
ptyprocess==0.7.0 ; python_version >= "3.9" and python_version < "4.0" and sys_platform != "win32"
pure-eval==0.2.2 ; python_version >= "3.9" and python_version < "4.0"
py==1.11.0 ; python_version >= "3.9" and python_version < "4.0"
pycparser==2.21 ; python_version >= "3.9" and python_version < "4.0" and implementation_name == "pypy"
pyecore==0.12.2 ; python_version >= "3.9" and python_version < "4.0"
pygments==2.13.0 ; python_version >= "3.9" and python_version < "4.0"
pyparsing==3.0.9 ; python_version >= "3.9" and python_version < "4.0"
pyrsistent==0.18.1 ; python_version >= "3.9" and python_version < "4.0"
pytest==7.1.3 ; python_version >= "3.9" and python_version < "4.0"
python-dateutil==2.8.2 ; python_version >= "3.9" and python_version < "4.0"
python-dotenv==0.21.0 ; python_version >= "3.9" and python_version < "4.0"
pytz==2022.4 ; python_version >= "3.9" and python_version < "4.0"
pywin32==304 ; sys_platform == "win32" and platform_python_implementation != "PyPy" and python_version >= "3.9" and python_version < "4.0"
pyyaml==6.0 ; python_version >= "3.9" and python_version < "4.0"
pyzmq==24.0.1 ; python_version >= "3.9" and python_version < "4.0"
requests==2.28.1 ; python_version >= "3.9" and python_version < "4"
restrictedpython==5.0 ; python_version >= "3.9" and python_version < "4.0"
setuptools==65.4.1 ; python_version >= "3.9" and python_version < "4.0"
six==1.16.0 ; python_version >= "3.9" and python_version < "4.0"
sniffio==1.3.0 ; python_version >= "3.9" and python_version < "4.0"
snowballstemmer==2.2.0 ; python_version >= "3.9" and python_version < "4.0"
sphinx-rtd-theme==1.0.0 ; python_version >= "3.9" and python_version < "4.0"
sphinx==5.2.3 ; python_version >= "3.9" and python_version < "4.0"
sphinxcontrib-applehelp==1.0.2 ; python_version >= "3.9" and python_version < "4.0"
sphinxcontrib-devhelp==1.0.2 ; python_version >= "3.9" and python_version < "4.0"
sphinxcontrib-htmlhelp==2.0.0 ; python_version >= "3.9" and python_version < "4.0"
sphinxcontrib-jsmath==1.0.1 ; python_version >= "3.9" and python_version < "4.0"
sphinxcontrib-qthelp==1.0.3 ; python_version >= "3.9" and python_version < "4.0"
sphinxcontrib-serializinghtml==1.1.5 ; python_version >= "3.9" and python_version < "4.0"
stack-data==0.5.1 ; python_version >= "3.9" and python_version < "4.0"
swagger-ui-bundle==0.0.9 ; python_version >= "3.9" and python_version < "4.0"
tomli==2.0.1 ; python_version >= "3.9" and python_version < "4.0"
tornado==6.2 ; python_version >= "3.9" and python_version < "4.0"
traitlets==5.4.0 ; python_version >= "3.9" and python_version < "4.0"
urllib3==1.26.12 ; python_version >= "3.9" and python_version < "4"
uvicorn[standard]==0.18.3 ; python_version >= "3.9" and python_version < "4.0"
uvloop==0.17.0 ; sys_platform != "win32" and sys_platform != "cygwin" and platform_python_implementation != "PyPy" and python_version >= "3.9" and python_version < "4.0"
watchfiles==0.17.0 ; python_version >= "3.9" and python_version < "4.0"
wcwidth==0.2.5 ; python_version >= "3.9" and python_version < "4.0"
websockets==10.3 ; python_version >= "3.9" and python_version < "4.0"
werkzeug==2.2.2 ; python_version >= "3.9" and python_version < "4.0"
z3-solver==4.11.2.0 ; python_version >= "3.9" and python_version < "4.0"
zipp==3.8.1 ; python_version >= "3.9" and python_version < "3.10"
This diff is collapsed.
[tool.poetry]
name = "mc_openapi"
version = "1.2.0"
description = "OpenAPI interface for the PIACERE DOML model checker."
authors = ["Michele Chiari <michele.chiari@polimi.it>", "Michele De Pascalis <michele.de.pascalis.1024@gmail.com>"]
license = "Apache-2.0"
[tool.poetry.dependencies]
python = "^3.9"
connexion = {extras = ["swagger-ui"], version = "^2.14"}
pyecore = "^0.12.2"
z3-solver = "^4.9"
PyYAML = "^6.0"
networkx = "^2.8"
joblib = "^1.1"
uvicorn = {extras = ["standard"], version = "^0.18"}
lark = "^1.1.2"
[tool.poetry.dev-dependencies]
pytest = "^7.0"
requests = "^2.28"
ipykernel = "^6.15"
prettyprinter = "^0.18"
Sphinx = "^5.0"
sphinx-rtd-theme = "^1.0"
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
anyio==3.6.1 ; python_version >= "3.9" and python_version < "4.0"
attrs==22.1.0 ; python_version >= "3.9" and python_version < "4.0"
certifi==2022.9.24 ; python_version >= "3.9" and python_version < "4"
charset-normalizer==2.1.1 ; python_version >= "3.9" and python_version < "4"
click==8.1.3 ; python_version >= "3.9" and python_version < "4.0"
clickclick==20.10.2 ; python_version >= "3.9" and python_version < "4.0"
colorama==0.4.5 ; sys_platform == "win32" and python_version >= "3.9" and python_version < "4.0" or python_version >= "3.9" and python_version < "4.0" and platform_system == "Windows"
connexion[swagger-ui]==2.14.1 ; python_version >= "3.9" and python_version < "4.0"
flask==2.2.2 ; python_version >= "3.9" and python_version < "4.0"
future-fstrings==1.2.0 ; python_version >= "3.9" and python_version < "4.0"
h11==0.14.0 ; python_version >= "3.9" and python_version < "4.0"
httptools==0.5.0 ; python_version >= "3.9" and python_version < "4.0"
idna==3.4 ; python_version >= "3.9" and python_version < "4"
importlib-metadata==5.0.0 ; python_version >= "3.9" and python_version < "3.10"
inflection==0.5.1 ; python_version >= "3.9" and python_version < "4.0"
itsdangerous==2.1.2 ; python_version >= "3.9" and python_version < "4.0"
jinja2==3.1.2 ; python_version >= "3.9" and python_version < "4.0"
joblib==1.2.0 ; python_version >= "3.9" and python_version < "4.0"
jsonschema==4.16.0 ; python_version >= "3.9" and python_version < "4.0"
lxml==4.9.1 ; python_version >= "3.9" and python_version < "4.0"
markupsafe==2.1.1 ; python_version >= "3.9" and python_version < "4.0"
networkx==2.8.7 ; python_version >= "3.9" and python_version < "4.0"
ordered-set==4.1.0 ; python_version >= "3.9" and python_version < "4.0"
packaging==21.3 ; python_version >= "3.9" and python_version < "4.0"
pyecore==0.12.2 ; python_version >= "3.9" and python_version < "4.0"
pyparsing==3.0.9 ; python_version >= "3.9" and python_version < "4.0"
pyrsistent==0.18.1 ; python_version >= "3.9" and python_version < "4.0"
python-dotenv==0.21.0 ; python_version >= "3.9" and python_version < "4.0"
pyyaml==6.0 ; python_version >= "3.9" and python_version < "4.0"
requests==2.28.1 ; python_version >= "3.9" and python_version < "4"
restrictedpython==5.0 ; python_version >= "3.9" and python_version < "4.0"
setuptools==65.4.1 ; python_version >= "3.9" and python_version < "4.0"
sniffio==1.3.0 ; python_version >= "3.9" and python_version < "4.0"
swagger-ui-bundle==0.0.9 ; python_version >= "3.9" and python_version < "4.0"
urllib3==1.26.12 ; python_version >= "3.9" and python_version < "4"
uvicorn[standard]==0.18.3 ; python_version >= "3.9" and python_version < "4.0"
uvloop==0.17.0 ; sys_platform != "win32" and sys_platform != "cygwin" and platform_python_implementation != "PyPy" and python_version >= "3.9" and python_version < "4.0"
watchfiles==0.17.0 ; python_version >= "3.9" and python_version < "4.0"
websockets==10.3 ; python_version >= "3.9" and python_version < "4.0"
werkzeug==2.2.2 ; python_version >= "3.9" and python_version < "4.0"
z3-solver==4.11.2.0 ; python_version >= "3.9" and python_version < "4.0"
zipp==3.8.1 ; python_version >= "3.9" and python_version < "3.10"
attrs==22.2.0
certifi==2022.12.7
charset-normalizer==3.0.1
click==8.1.3
clickclick==20.10.2
connexion==2.14.2
Flask==2.2.2
future-fstrings==1.2.0
h11==0.14.0
idna==3.4
inflection==0.5.1
iniconfig==2.0.0
itsdangerous==2.1.2
Jinja2==3.1.2
joblib==1.2.0
jsonschema==4.17.3
lark==1.1.5
lxml==4.9.2
MarkupSafe==2.1.2
networkx==3.0
ordered-set==4.1.0
packaging==23.0
pluggy==1.0.0
pyecore==0.13.0
pyrsistent==0.19.3
pytest==7.2.1
PyYAML==6.0
requests==2.28.2
RestrictedPython==6.0
swagger-ui-bundle==0.0.9
urllib3==1.26.14
uvicorn==0.20.0
Werkzeug==2.2.2
z3-solver==4.12.1.0
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment