Skip to content
This repository has been archived by the owner on Feb 4, 2025. It is now read-only.

Commit

Permalink
Merge pull request #30 from cvxgrp/29-towards-uv
Browse files Browse the repository at this point in the history
29 towards uv
  • Loading branch information
tschm authored Jan 9, 2025
2 parents 0a04683 + 42446d5 commit 5e1fec4
Show file tree
Hide file tree
Showing 19 changed files with 573 additions and 523 deletions.
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
TASK_X_REMOTE_TASKFILES=1
5 changes: 4 additions & 1 deletion .github/workflows/basic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,7 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: cvxgrp/.github/actions/[email protected]
- name: Checkout [${{ github.repository }}]
uses: actions/checkout@v4

- uses: cvxgrp/.github/actions/uv/[email protected]
10 changes: 8 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: cvxgrp/.github/actions/[email protected]
- name: Checkout [${{ github.repository }}]
uses: actions/checkout@v4

- uses: cvxgrp/.github/actions/uv/[email protected]

deploy:
runs-on: ubuntu-latest
Expand All @@ -21,4 +24,7 @@ jobs:
id-token: write

steps:
- uses: cvxgrp/.github/actions/[email protected]
- name: Checkout [${{ github.repository }}]
uses: actions/checkout@v4

- uses: cvxgrp/.github/actions/[email protected]
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.DS_Store
.idea
.task
__pycache__

CONTRIBUTING.md
Expand Down
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.12
47 changes: 0 additions & 47 deletions Makefile

This file was deleted.

8 changes: 3 additions & 5 deletions cvx/cook.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from pathlib import Path
from loguru import logger

import fire
from loguru import logger

from cvx.cooker.parse import toml_data, write, jinja_environment
from cvx.cooker.parse import jinja_environment, toml_data, write


def parse(file="pyproject.toml"):
Expand All @@ -30,10 +30,9 @@ def f(source, target):
for key, value in data.items():
logger.info(f" {key}: {value}")

assert "homepage" in data, "homepage must be specified in pyproject.toml"
assert "authors" in data, "authors must be specified in pyproject.toml"
assert "name" in data, "name must be specified in pyproject.toml"
assert "packages" in data, "packages must be specified in pyproject.toml"


env = jinja_environment(Path(__file__).parent)
logger.info("Jinja environment created")
Expand All @@ -46,7 +45,6 @@ def f(source, target):
f("templates/contributions/CONTRIBUTING.md", "CONTRIBUTING.md"),
f("templates/contributions/CODE_OF_CONDUCT.md", "CODE_OF_CONDUCT.md")
f("templates/book/_config.yml", "book/_config.yml")
f("templates/book/sphinx/conf.py", sphinx / "conf.py")
f("templates/book/docs/api.md", book / "api.md")
f("templates/book/docs/reports.md", book / "reports.md")
f("templates/readme/README.md", "README2.md")
Expand Down
4 changes: 2 additions & 2 deletions cvx/cooker/parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
# limitations under the License.
import codecs

from jinja2 import FileSystemLoader, Environment
import toml
from jinja2 import Environment, FileSystemLoader


def toml_data(toml_file="pyproject.toml"):
d = toml.load(toml_file)
return d["tool"]["poetry"]
return d["project"]


def jinja_environment(folder):
Expand Down
3 changes: 0 additions & 3 deletions cvx/templates/book/_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ title: {{ name }}
author: {{ authors[0] }}
only_build_toc_files: true

execute:
execute_notebooks: force
timeout: 240

parse:
myst_enable_extensions:
Expand Down
3 changes: 0 additions & 3 deletions cvx/templates/book/_toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,5 @@
format: jb-book
root: docs/index
chapters:
- file: docs/nb
sections:
- glob: docs/notebooks/*
- file: docs/api
- file: docs/reports
3 changes: 1 addition & 2 deletions cvx/templates/book/docs/api.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# API

## Sphinx

[API]({{ homepage }}/sphinx/)
[API]({{ homepage }}/pdoc/)
52 changes: 0 additions & 52 deletions cvx/templates/book/sphinx/conf.py

This file was deleted.

Loading

0 comments on commit 5e1fec4

Please sign in to comment.