Skip to content

Commit 974de31

Browse files
committed
move to uv
1 parent 081b5ac commit 974de31

File tree

7 files changed

+1568
-3817
lines changed

7 files changed

+1568
-3817
lines changed

.github/workflows/codecov.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@ jobs:
3030
run: |
3131
pip install pytest pytest-cov
3232
pytest --cov=./ --cov-report=xml
33-
- name: Upload coverage to Codecov
34-
uses: codecov/codecov-action@v3
35-
with:
36-
files: ./coverage.xml
37-
fail_ci_if_error: true
33+
34+
# - name: Upload coverage to Codecov
35+
# uses: codecov/codecov-action@v3
36+
# with:
37+
# files: ./coverage.xml
38+
# fail_ci_if_error: true

.github/workflows/main.yml

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,18 @@ jobs:
3030
- name: Install dependencies
3131
run: |
3232
pip install -r requirements.txt
33-
pip install pytest isort black flake8
34-
pip install ecos
33+
pip install pytest ecos
34+
# isort black flake8
35+
# pip install ecos
3536
- name: Test with pytest
3637
run: |
3738
pytest ./tests
38-
- name: Check with isort
39-
run: |
40-
isort --check --diff .
41-
- name: Check with black
42-
run: |
43-
black --check --diff .
44-
- name: Check with flake8
45-
run: |
46-
flake8 --show-source --statistics .
39+
#- name: Check with isort
40+
# run: |
41+
# isort --check --diff .
42+
#- name: Check with black
43+
# run: |
44+
# black --check --diff .
45+
#- name: Check with flake8
46+
# run: |
47+
# flake8 --show-source --statistics .

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.12

Makefile

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
.DEFAULT_GOAL := help
2+
3+
SHELL=/bin/bash
4+
5+
UNAME=$(shell uname -s)
6+
7+
.PHONY: install
8+
install: ## Install a virtual environment with all extras
9+
@curl -LsSf https://astral.sh/uv/install.sh | sh
10+
@uv venv
11+
@uv sync -vv --all-extras
12+
@echo "Virtual environment created with all extras. Activate with:"
13+
@echo "source .venv/bin/activate"
14+
15+
.PHONY: fmt
16+
fmt: ## Run autoformatting and linting
17+
@uv pip install pre-commit
18+
@uv run pre-commit install
19+
@uv run pre-commit run --all-files
20+
21+
22+
.PHONY: test
23+
test: install ## Run tests
24+
@uv run pytest
25+
26+
27+
.PHONY: clean
28+
clean: ## Clean up caches and build artifacts
29+
@git clean -X -d -f
30+
31+
32+
.PHONY: coverage
33+
coverage: install ## test and coverage
34+
@uv run coverage run --source=cvx/. -m pytest
35+
@uv run coverage report -m
36+
@uv run coverage html
37+
38+
@if [ ${UNAME} == "Darwin" ]; then \
39+
open htmlcov/index.html; \
40+
elif [ ${UNAME} == "linux" ]; then \
41+
xdg-open htmlcov/index.html 2> /dev/null; \
42+
fi
43+
44+
45+
.PHONY: help
46+
help: ## Display this help screen
47+
@echo -e "\033[1mAvailable commands:\033[0m"
48+
@grep -E '^[a-z.A-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-18s\033[0m %s\n", $$1, $$2}' | sort

poetry.lock

Lines changed: 0 additions & 3767 deletions
This file was deleted.

pyproject.toml

Lines changed: 82 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1-
[tool.poetry]
1+
[project]
22
name = "pyportfolioopt"
3-
version = "1.5.6"
3+
version = "0.0.0"
44
description = "Financial portfolio optimization in python"
55
license = "MIT"
6-
authors = ["Robert Andrew Martin <[email protected]>"]
6+
authors = [{name="Robert Andrew Martin", email="[email protected]"}]
77
readme = "README.md"
88
repository = "https://github.com/robertmartin8/PyPortfolioOpt"
99
documentation = "https://pyportfolioopt.readthedocs.io/en/latest/"
1010
keywords= ["finance", "portfolio", "optimization", "quant", "investing"]
11+
requires-python = ">=3.10"
1112
classifiers=[
1213
"Development Status :: 4 - Beta",
1314
"Environment :: Console",
@@ -25,43 +26,90 @@ classifiers=[
2526
"Topic :: Office/Business :: Financial",
2627
"Topic :: Office/Business :: Financial :: Investment",
2728
]
28-
packages = [ {include = "pypfopt"} ]
29+
dependencies = [
30+
"scipy",
31+
"pandas",
32+
"cvxpy",
33+
"numpy"
34+
]
2935

30-
[tool.poetry.urls]
31-
"Issues" = "https://github.com/robertmartin8/PyPortfolioOpt/issues"
32-
"Personal website" = "https://reasonabledeviations.com"
36+
#[tool.poetry.urls]
37+
#"Issues" = "https://github.com/robertmartin8/PyPortfolioOpt/issues"
38+
#"Personal website" = "https://reasonabledeviations.com"
3339

34-
[tool.poetry.dependencies]
35-
python = ">=3.9"
36-
scipy = ">=1.3"
37-
pandas = ">=0.19"
38-
cvxpy = ">=1.1.19"
39-
numpy = ">=1.26.0"
40-
matplotlib = { version=">=3.2.0", optional=true }
41-
scikit-learn = { version=">=0.24.1", optional=true }
42-
ecos = { version="^2.0.14", optional=true }
43-
plotly = { version="^5.0.0", optional=true }
40+
[project.optional-dependencies]
41+
plot = [
42+
"matplotlib",
43+
"plotly",
44+
"scikit-learn",
45+
"ecos"
46+
]
4447

45-
[tool.poetry.dev-dependencies]
46-
pytest = ">=7.1.2"
47-
flake8 = ">=4.0.1"
48-
jupyterlab = ">=3.4.2"
49-
black = ">=22.3.0"
50-
ipykernel = ">=6.13.0"
51-
jedi = ">=0.18.1"
52-
pytest-cov = ">=3.0.0"
53-
yfinance = ">=0.1.70"
48+
[dependency-groups]
49+
dev = [
50+
"pytest-cov>=6.0.0",
51+
"pytest>=8.3.3",
52+
"pre-commit>=4.0.1",
53+
"jedi",
54+
"yfinance",
55+
"ecos"
56+
]
5457

55-
[tool.poetry.extras]
56-
optionals = ["scikit-learn", "matplotlib", "cvxopt"]
58+
#excel = [
59+
# "odfpy>=1.4.1",
60+
# "openpyxl>=3.1.0",
61+
# "python-calamine>=0.1.7",
62+
# "pyxlsb>=1.0.10",
63+
# "xlrd>=2.0.1",
64+
# "xlsxwriter>=3.0.5"
65+
#]
66+
67+
#[tool.poetry.dependencies]
68+
#python = ">=3.9"
69+
#scipy = ">=1.3"
70+
#pandas = ">=0.19"
71+
#cvxpy = ">=1.1.19"
72+
#numpy = ">=1.26.0"
73+
#matplotlib = { version=">=3.2.0", optional=true }
74+
#scikit-learn = { version=">=0.24.1", optional=true }
75+
#ecos = { version="^2.0.14", optional=true }
76+
#plotly = { version="^5.0.0", optional=true }
77+
78+
#[tool.poetry.dev-dependencies]
79+
#pytest = ">=7.1.2"
80+
#flake8 = ">=4.0.1"
81+
#jupyterlab = ">=3.4.2"
82+
#black = ">=22.3.0"
83+
#ipykernel = ">=6.13.0"
84+
#jedi = ">=0.18.1"
85+
#pytest-cov = ">=3.0.0"
86+
#yfinance = ">=0.1.70"
87+
88+
#[tool.poetry.extras]
89+
#optionals = ["scikit-learn", "matplotlib", "cvxopt"]
90+
91+
[tool.ruff]
92+
select = ["E", "F", "I"]
93+
line-length = 120
94+
target-version = "py310"
95+
exclude = [
96+
"*__init__.py", "tests/test_imports.py"
97+
]
5798

5899
[build-system]
59-
requires = ["poetry-core>=1.0.0"]
60-
build-backend = "poetry.core.masonry.api"
100+
requires = ["hatchling"]
101+
build-backend = "hatchling.build"
102+
103+
[tool.hatch.build.targets.wheel]
104+
packages = ["pypfopt"]
105+
106+
#[build-system]
107+
#requires = ["poetry-core>=1.0.0"]
108+
#build-backend = "poetry.core.masonry.api"
61109

62110

63-
[tool.black]
64-
line-length = 88
111+
#[tool.black]
112+
#line-length = 88
65113

66-
[tool.isort]
67-
profile = "black"
114+
#[tool.isort]
115+
#profile = "black"

0 commit comments

Comments
 (0)