-
Notifications
You must be signed in to change notification settings - Fork 116
Move Makefile to uv and simplified README #90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
tschm
wants to merge
8
commits into
master
Choose a base branch
from
89-move-to-uv
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
46044f8
Move Makefile to uv and simplified README
tschm 131cee1
Update README.md
tschm 3a8d6de
Update Makefile
tschm f457b62
Move Makefile to uv and simplified README
tschm 0f292f1
Move Makefile to uv and simplified README
tschm 6c1b4d0
Move Makefile to uv and simplified README
tschm 663d857
introduce "make test"
tschm 346be35
introduce "make test"
tschm File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,36 +1,53 @@ | ||
| # This Makefile provides commands for setting up the development environment, | ||
| # running formatting tools, and cleaning the repository. | ||
|
|
||
| # Set the default target to 'help' when running make without arguments | ||
| .DEFAULT_GOAL := help | ||
|
|
||
| VENV :=.venv | ||
| # Create a Python virtual environment using uv (faster alternative to venv) | ||
| .PHONY: venv | ||
| venv: | ||
| curl -LsSf https://astral.sh/uv/install.sh | sh; | ||
| @uv venv # Create a virtual environment in the current directory | ||
|
|
||
| # Mark 'install' as a phony target (not associated with a file) | ||
| .PHONY: install | ||
| install: ## Install a virtual environment | ||
| python -m venv ${VENV} | ||
| ${VENV}/bin/pip install --upgrade pip | ||
| ${VENV}/bin/pip install -r requirements.txt | ||
| install: venv ## Install a virtual environment | ||
| @uv pip install --upgrade pip # Ensure pip is up to date | ||
| @uv pip install --no-cache-dir -r requirements.txt # Install project dependencies from requirements.txt | ||
|
|
||
| # Code Quality | ||
| .PHONY: fmt | ||
| fmt: install ## Run autoformatting and linting | ||
| ${VENV}/bin/pip install pre-commit | ||
| ${VENV}/bin/pre-commit install | ||
| ${VENV}/bin/pre-commit run --all-files | ||
| @uv pip install pre-commit # Install pre-commit hooks | ||
| @uv run pre-commit install # Set up pre-commit hooks | ||
| @uv run pre-commit run --all-files # Run pre-commit hooks on all files | ||
|
|
||
| # Book Building | ||
| .PHONY: build | ||
| build: install ## Build the book | ||
| ${VENV}/bin/pip install jupyter-book | ||
| ${VENV}/bin/jupyter-book clean book | ||
| ${VENV}/bin/jupyter-book build book | ||
| touch book/_build/html/.nojekyll | ||
| @uv pip install jupyter-book # Install jupyter-book | ||
| @uv run jupyter-book clean book # Clean previous builds | ||
| @uv run jupyter-book build book # Build the book | ||
| touch book/_build/html/.nojekyll # Add .nojekyll file for GitHub Pages | ||
|
|
||
| # Cleanup | ||
| .PHONY: clean | ||
| clean: ## Clean up caches and build artifacts | ||
| @git clean -X -d -f | ||
| @git clean -X -d -f # Remove files ignored by git | ||
|
|
||
| # Help | ||
| .PHONY: help | ||
| help: ## Display this help screen | ||
| @echo -e "\033[1mAvailable commands:\033[0m" | ||
| @grep -E '^[a-z.A-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-18s\033[0m %s\n", $$1, $$2}' | sort | ||
| @echo -e "\033[1mAvailable commands:\033[0m" # Print header in bold | ||
| @grep -E '^[a-z.A-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-18s\033[0m %s\n", $$1, $$2}' | sort # Extract and format targets with comments | ||
|
|
||
| # Jupyter Setup | ||
| .PHONY: jupyter | ||
| jupyter: install ## Start jupyterlab | ||
| ${VENV}/bin/pip install jupyterlab | ||
| ${VENV}/bin/jupyter lab | ||
| @uv pip install jupyterlab # Install JupyterLab | ||
| @uv run jupyter lab # Start JupyterLab server | ||
|
|
||
| .PHONY: test | ||
| test: install ## Run the tests | ||
| @uv run python -m test | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,15 +1,16 @@ | ||
| # [CVXPY tutorial](https://cvxgrp.org/cvx_short_course) | ||
| # 📊 [CVXPY tutorial](https://cvxgrp.org/cvx_short_course) | ||
|
|
||
| ## 📋 Overview | ||
|
|
||
| CVXPY is an open source Python-embedded modeling language for convex | ||
| optimization problems. It lets you express your problem in a natural way that | ||
| follows the math, rather than in the restrictive standard form required by | ||
| solvers. This tutorial will cover the basics of convex optimization, and how to | ||
| optimization problems. It lets you express your problem naturally, following | ||
| the math, rather than in the restrictive standard form required by | ||
| solvers. This tutorial will cover the basics of convex optimization and how to | ||
| use CVXPY to specify and solve convex optimization problems, with an emphasis on | ||
| real-world applications. No prior knowledge of convex optimization is assumed. | ||
|
|
||
| ## Getting started | ||
| ## 🚀 Getting started | ||
|
|
||
| 1. Clone this repository. | ||
| 2. Install CVXPY following [these instructions](https://www.cvxpy.org/install/index.html). | ||
| We recommend Python 3.10 and CVXPY 1.3. | ||
| 3. Test your CVXPY installation by running ``test.py`` in the repository. | ||
| 2. Install CVXPY by running ``make install`` | ||
| 3. Test your CVXPY installation by running ``make test`` in the repository. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.