Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ jobs:
run: |
pip install -r requirements.txt
pip install ecos
pip install -e .
- name: Generate coverage report
run: |
pip install pytest pytest-cov
Expand Down
46 changes: 46 additions & 0 deletions .github/workflows/deptry.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# This file is part of the tschm/.config-templates repository
# (https://github.com/tschm/.config-templates).
#
# Workflow: Deptry
#
# Purpose: This workflow identifies missing and obsolete dependencies in the project.
# It helps maintain a clean dependency tree by detecting unused packages and
# implicit dependencies that should be explicitly declared.
#
# Trigger: This workflow runs on every push and on pull requests to main/master
# branches (including from forks)

name: "DEPTRY"

# Permissions: Only read access to repository contents is needed
permissions:
contents: read

on:
push:
pull_request:
branches: [ main, master ]

jobs:
deptry_analysis:
name: Check dependencies with deptry
runs-on: ubuntu-latest
container:
image: ghcr.io/astral-sh/uv:0.9.5-python3.12-trixie

steps:
- uses: actions/checkout@v5

- name: Run deptry
run: |
set -euo pipefail
if [ -f "pyproject.toml" ]; then
if [ -d "src" ]; then
SOURCE_FOLDER="src"
else
SOURCE_FOLDER="."
fi
uvx deptry "$SOURCE_FOLDER"
else
printf "${YELLOW:-}[WARN] No pyproject.toml found, skipping deptry${RESET:-}\n"
fi
21 changes: 12 additions & 9 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,18 @@ jobs:
pip install -r requirements.txt
pip install pytest isort black flake8
pip install ecos
pip install -e .
- name: Test with pytest
run: |
pytest ./tests
- name: Check with isort
run: |
isort --check --diff .
- name: Check with black
run: |
black --check --diff .
- name: Check with flake8
run: |
flake8 --show-source --statistics .

# will be replaced by ruff
# - name: Check with isort
# run: |
# isort --check --diff .
# - name: Check with black
# run: |
# black --check --diff .
# - name: Check with flake8
# run: |
# flake8 --show-source --statistics .
3,767 changes: 0 additions & 3,767 deletions poetry.lock

This file was deleted.

132 changes: 77 additions & 55 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,67 +1,89 @@
[tool.poetry]
name = "pyportfolioopt"
[project]
name = "pypfopt"
version = "1.5.6"
description = "Financial portfolio optimization in python"
license = "MIT"
authors = ["Robert Andrew Martin <martin.robertandrew@gmail.com>"]
readme = "README.md"
repository = "https://github.com/pyportfolio/pyportfolioopt"
documentation = "https://pyportfolioopt.readthedocs.io/en/latest/"
keywords= ["finance", "portfolio", "optimization", "quant", "investing"]
classifiers=[
"Development Status :: 4 - Beta",
"Environment :: Console",
"Intended Audience :: Financial and Insurance Industry",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3 :: Only",
"Topic :: Office/Business :: Financial",
"Topic :: Office/Business :: Financial :: Investment",
]
packages = [ {include = "pypfopt"} ]
requires-python = ">=3.10"
license = { file = "LICENSE.txt" }
authors = [
{ name = "Robert Andrew Martin", email = "martin.robertandrew@gmail.com" }
]
keywords = ["finance", "portfolio", "optimization", "quant", "investing"]
classifiers = [
"Development Status :: 4 - Beta",
"Environment :: Console",
"Intended Audience :: Financial and Insurance Industry",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3 :: Only",
"Topic :: Office/Business :: Financial",
"Topic :: Office/Business :: Financial :: Investment",
]

[tool.poetry.urls]
"Issues" = "https://github.com/pyportfolio/pyportfolioopt/issues"
# Core runtime dependencies
dependencies = [
"plotly>=6.3.0",
"matplotlib>=3.10.7",
"scipy>=1.3",
"pandas>=0.19",
"cvxpy>=1.1.19",
"numpy>=1.26.0",
"scikit-learn>=1.7.2"
]

#[project.optional-dependencies]
## Preserve the Poetry extra named "optionals"
#optionals = [
# "scikit-learn>=0.24.1",
# "matplotlib>=3.2.0"
#]

[project.urls]
Repository = "https://github.com/pyportfolio/pyportfolioopt"
Documentation = "https://pyportfolioopt.readthedocs.io/en/latest/"
Issues = "https://github.com/pyportfolio/pyportfolioopt/issues"
"Personal website" = "https://reasonabledeviations.com"

[tool.poetry.dependencies]
python = ">=3.9"
scipy = ">=1.3"
pandas = ">=0.19"
cvxpy = ">=1.1.19"
numpy = ">=1.26.0"
matplotlib = { version=">=3.2.0", optional=true }
scikit-learn = { version=">=0.24.1", optional=true }
ecos = { version="^2.0.14", optional=true }
plotly = { version="^5.0.0", optional=true }
# Build system configuration
# Hatchling is a modern, extensible Python build backend
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.poetry.dev-dependencies]
pytest = ">=7.1.2"
flake8 = ">=4.0.1"
jupyterlab = ">=3.4.2"
black = ">=22.3.0"
ipykernel = ">=6.13.0"
jedi = ">=0.18.1"
pytest-cov = ">=3.0.0"
yfinance = ">=0.1.70"
[tool.hatch.build.targets.wheel]
packages = ["src/pypfopt"]

[tool.poetry.extras]
optionals = ["scikit-learn", "matplotlib", "cvxopt"]
#[tool.black]
#line-length = 88

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
#[tool.isort]
#profile = "black"
# will all be controlled by ruff.toml

[project.optional-dependencies]
# Development-only dependencies (not included when installing the package)
dev = [
"pytest>=7.1.2",
"flake8>=4.0.1",
"jupyterlab>=3.4.2",
"black>=22.3.0",
"ipykernel>=6.13.0",
"jedi>=0.18.1",
"pytest-cov>=3.0.0",
"yfinance>=0.1.70",
"ecos>=2.0.14",
"pre-commit==4.3.0",
]

[tool.black]
line-length = 88
[tool.deptry.per_rule_ignores]
DEP001 = ["sklearn"]
DEP002 = ["scikit-learn"]

[tool.isort]
profile = "black"
[tool.deptry]
# see https://deptry.com/usage/#pep-621-dev-dependency-groups
pep621_dev_dependency_groups = ["dev"]
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading