From dca5f1e0aff500e62bda63f3fb6ec7199a92be93 Mon Sep 17 00:00:00 2001 From: benedettoleto Date: Fri, 3 May 2024 21:48:43 +0200 Subject: [PATCH 1/6] code style optimization and upgrade action setups --- .github/workflows/publish-final-dist.yaml | 4 ++-- .github/workflows/publish-test-dist.yaml | 4 ++-- .github/workflows/python-tests.yaml | 6 +++--- pyproject.toml | 3 ++- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/publish-final-dist.yaml b/.github/workflows/publish-final-dist.yaml index 8fe325c1..92db233a 100644 --- a/.github/workflows/publish-final-dist.yaml +++ b/.github/workflows/publish-final-dist.yaml @@ -10,10 +10,10 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: '3.8' diff --git a/.github/workflows/publish-test-dist.yaml b/.github/workflows/publish-test-dist.yaml index 0a74b979..922157b4 100644 --- a/.github/workflows/publish-test-dist.yaml +++ b/.github/workflows/publish-test-dist.yaml @@ -12,10 +12,10 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: '3.8' diff --git a/.github/workflows/python-tests.yaml b/.github/workflows/python-tests.yaml index 6976eaf5..3b731435 100644 --- a/.github/workflows/python-tests.yaml +++ b/.github/workflows/python-tests.yaml @@ -73,14 +73,14 @@ jobs: run: | poetry run pytest tests/ --cov=arbitragelab --cov-report=term --cov-branch --cov-config=.coveragerc - - name: Generate coverage XML report + - name: Generate coverage HTML report run: poetry run coverage html - - name: Upload Coverage XML Report as Artifact + - name: Upload Coverage HTML Report as Artifact uses: actions/upload-artifact@v4 with: name: coverage-html - path: coverage.html + path: build/coverage/html/index.html - name: Check coverage run: poetry run coverage report --fail-under=100 diff --git a/pyproject.toml b/pyproject.toml index 7d486184..4a15208f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -27,7 +27,7 @@ packages = [ { include = "arbitragelab" } ] -exclude = ["contrib", "docs", "tests"] +exclude = ["docs", "tests"] [tool.poetry.dependencies] python = "^3.8" @@ -130,4 +130,5 @@ sphinx-copybutton = "0.5.2" six = "*" [tool.poetry.extras] +tests = ["coverage", "pylint", "pytest", "pytest-cov", "pyarmor"] docs = ["sphinx", "sphinx-rtd-theme", "sphinx-tabs", "sphinx-autoapi", "sphinx-copybutton", "myst-parser", "hudsonthames-sphinx-theme", "docutils", "jinja2", "releases"] \ No newline at end of file From 912439af0eb52efe30b2ad2ae3a315717627d67e Mon Sep 17 00:00:00 2001 From: benedettoleto Date: Fri, 3 May 2024 22:33:02 +0200 Subject: [PATCH 2/6] fix coverage workflow --- .github/workflows/python-tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-tests.yaml b/.github/workflows/python-tests.yaml index 3b731435..e7d03171 100644 --- a/.github/workflows/python-tests.yaml +++ b/.github/workflows/python-tests.yaml @@ -79,7 +79,7 @@ jobs: - name: Upload Coverage HTML Report as Artifact uses: actions/upload-artifact@v4 with: - name: coverage-html + name: coverage-html-${{ matrix.python-version }} path: build/coverage/html/index.html - name: Check coverage From a0347130a58365670a0ea6b23eefefc32b0931de Mon Sep 17 00:00:00 2001 From: benedettoleto Date: Fri, 3 May 2024 23:35:54 +0200 Subject: [PATCH 3/6] remove comments --- .github/workflows/python-tests.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-tests.yaml b/.github/workflows/python-tests.yaml index e7d03171..a7819a07 100644 --- a/.github/workflows/python-tests.yaml +++ b/.github/workflows/python-tests.yaml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] # Add versions as needed + python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] steps: - name: Checkout code @@ -49,7 +49,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] # Add versions as needed + python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] steps: - name: Checkout code From 72e23410fd10399ebdde391b04e70d6258754b71 Mon Sep 17 00:00:00 2001 From: benedettoleto Date: Sat, 4 May 2024 13:10:21 +0200 Subject: [PATCH 4/6] change docs build (trial) --- .readthedocs.yml | 22 ++++++++++-------- docs/source/requirements.txt | 45 ++++++++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+), 9 deletions(-) create mode 100644 docs/source/requirements.txt diff --git a/.readthedocs.yml b/.readthedocs.yml index 5df10a44..d2a0bb56 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -1,20 +1,24 @@ # .readthedocs.yml # Read the Docs configuration file +# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details +# Required version: 2 build: - os: "ubuntu-22.04" + os: ubuntu-22.04 tools: python: "3.8" - jobs: - post_create_environment: - # Install poetry - - pip install poetry - post_install: - # Install dependencies - - VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH poetry install --only docs +# Build documentation in the docs/ directory with Sphinx sphinx: - configuration: docs/source/conf.py + configuration: docs/source/conf.py + +# Optionally build your docs in additional formats such as PDF +formats: [] + +# Optionally set the version of Python and requirements required to build your docs +python: + install: + - requirements: docs/source/requirements.txt diff --git a/docs/source/requirements.txt b/docs/source/requirements.txt new file mode 100644 index 00000000..ad13dad9 --- /dev/null +++ b/docs/source/requirements.txt @@ -0,0 +1,45 @@ +# Production +POT==0.9.0 +analytics-python>=1.2.7, <2.0.0 +arch==5.5.0 +cvxpy==1.3.1 +cython==0.29.28 +dash==2.10.2 +getmac>=0.8.0, <1.0.0 +jupyter-dash>=0.2.0, <1.0.0 +keras==2.12.0 +lxml>=4.9.1 +matplotlib==3.7.1 +mpmath==1.2.1 +networkx>=2.2, <2.6 +numpy==1.23.5 +pandas==2.0.0 +pmdarima==2.0.3 +protobuf>=3.20.3 +pyvinecopulib==0.5.5 +requests_html==0.10.0 +scikit-learn==1.1.3 +scipy>=1.2.0, <2.0.0 +scs==3.2.0 +seaborn==0.12.2 +statsmodels==0.14.0 +tensorflow-macos==2.12.0; sys_platform == 'darwin' and platform_machine == 'arm64' +tensorflow==2.12.0; sys_platform != 'darwin' or platform_machine != 'arm64' +werkzeug==2.2.3 +yahoo-fin==0.8.9.1 +yfinance==0.2.24 + +# Develop +coverage==7.2.7 +docutils==0.18.1 # Docs +hudsonthames-sphinx-theme==0.1.5 # Docs +jinja2<3.1 # Docs +pyarmor==8.2.5 # Encryption +pylint==2.17.4 +pytest==7.3.1 +releases==1.6.3 # Docs +sphinx-copybutton==0.5.2 # docs +sphinx-rtd-theme==1.2.2 # docs +sphinx-autoapi==2.1.1 +sphinx-tabs==3.4.1 +myst-parser==2.0.0 # Docs \ No newline at end of file From 674527fd738b5c4a4b26a21bfe0b93bdf6e67e96 Mon Sep 17 00:00:00 2001 From: benedettoleto Date: Sat, 4 May 2024 13:14:45 +0200 Subject: [PATCH 5/6] reinstate previous doc building --- .readthedocs.yml | 22 ++++++++---------- docs/source/requirements.txt | 45 ------------------------------------ 2 files changed, 9 insertions(+), 58 deletions(-) delete mode 100644 docs/source/requirements.txt diff --git a/.readthedocs.yml b/.readthedocs.yml index d2a0bb56..5df10a44 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -1,24 +1,20 @@ # .readthedocs.yml # Read the Docs configuration file -# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details -# Required version: 2 build: - os: ubuntu-22.04 + os: "ubuntu-22.04" tools: python: "3.8" + jobs: + post_create_environment: + # Install poetry + - pip install poetry + post_install: + # Install dependencies + - VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH poetry install --only docs -# Build documentation in the docs/ directory with Sphinx sphinx: - configuration: docs/source/conf.py - -# Optionally build your docs in additional formats such as PDF -formats: [] - -# Optionally set the version of Python and requirements required to build your docs -python: - install: - - requirements: docs/source/requirements.txt + configuration: docs/source/conf.py diff --git a/docs/source/requirements.txt b/docs/source/requirements.txt deleted file mode 100644 index ad13dad9..00000000 --- a/docs/source/requirements.txt +++ /dev/null @@ -1,45 +0,0 @@ -# Production -POT==0.9.0 -analytics-python>=1.2.7, <2.0.0 -arch==5.5.0 -cvxpy==1.3.1 -cython==0.29.28 -dash==2.10.2 -getmac>=0.8.0, <1.0.0 -jupyter-dash>=0.2.0, <1.0.0 -keras==2.12.0 -lxml>=4.9.1 -matplotlib==3.7.1 -mpmath==1.2.1 -networkx>=2.2, <2.6 -numpy==1.23.5 -pandas==2.0.0 -pmdarima==2.0.3 -protobuf>=3.20.3 -pyvinecopulib==0.5.5 -requests_html==0.10.0 -scikit-learn==1.1.3 -scipy>=1.2.0, <2.0.0 -scs==3.2.0 -seaborn==0.12.2 -statsmodels==0.14.0 -tensorflow-macos==2.12.0; sys_platform == 'darwin' and platform_machine == 'arm64' -tensorflow==2.12.0; sys_platform != 'darwin' or platform_machine != 'arm64' -werkzeug==2.2.3 -yahoo-fin==0.8.9.1 -yfinance==0.2.24 - -# Develop -coverage==7.2.7 -docutils==0.18.1 # Docs -hudsonthames-sphinx-theme==0.1.5 # Docs -jinja2<3.1 # Docs -pyarmor==8.2.5 # Encryption -pylint==2.17.4 -pytest==7.3.1 -releases==1.6.3 # Docs -sphinx-copybutton==0.5.2 # docs -sphinx-rtd-theme==1.2.2 # docs -sphinx-autoapi==2.1.1 -sphinx-tabs==3.4.1 -myst-parser==2.0.0 # Docs \ No newline at end of file From 6351d8198e171abbb2db656b6bd3a3b1e883abdf Mon Sep 17 00:00:00 2001 From: benedettoleto Date: Wed, 8 May 2024 11:23:38 +0200 Subject: [PATCH 6/6] remove unnecessary dependency package --- pyproject.toml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 4a15208f..0cd24886 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -113,7 +113,6 @@ build-backend = "poetry.core.masonry.api" coverage = "7.2.7" pylint = "3.1.0" pytest = "7.3.1" -pyarmor = "8.5.2" pytest-cov = "3.0.0" [tool.poetry.group.docs.dependencies] @@ -130,5 +129,5 @@ sphinx-copybutton = "0.5.2" six = "*" [tool.poetry.extras] -tests = ["coverage", "pylint", "pytest", "pytest-cov", "pyarmor"] +tests = ["coverage", "pylint", "pytest", "pytest-cov"] docs = ["sphinx", "sphinx-rtd-theme", "sphinx-tabs", "sphinx-autoapi", "sphinx-copybutton", "myst-parser", "hudsonthames-sphinx-theme", "docutils", "jinja2", "releases"] \ No newline at end of file