Skip to content

Enh/uv pyproject #41

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

Merged
merged 19 commits into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from 6 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
20 changes: 0 additions & 20 deletions .flake8

This file was deleted.

1 change: 0 additions & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ jobs:
python-version: 3.8
- name: Build documentation
run: |
make venv
make dev
make pages
- name: Deploy documentation
Expand Down
7 changes: 1 addition & 6 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,13 @@ jobs:
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: ["3.6", "3.7", "3.8", "3.9"]
python-version: ["3.10", "3.11", "3.12", 3.13"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Create env
run: make venv
- name: Install dependencies
run: make dev
- name: Lint with flake8
Expand All @@ -37,8 +35,6 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: '3.8'
- name: Create env
run: make venv
- name: Install dependencies
run: make install
- name: Build package
Expand All @@ -51,4 +47,3 @@ jobs:
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}

2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
# You can use PyPy versions in python-version.
# For example, pypy-2.7 and pypy-3.8
matrix:
python-version: ["2.7", "3.7", "3.8", "3.9", "3.10"]
python-version: ["3.10", "3.11", "3.12", "3.13"]

steps:
- uses: actions/checkout@v3
Expand Down
21 changes: 0 additions & 21 deletions .readthedocs.yml

This file was deleted.

13 changes: 0 additions & 13 deletions .travis.yml

This file was deleted.

3 changes: 0 additions & 3 deletions MANIFEST.in

This file was deleted.

56 changes: 32 additions & 24 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,45 +1,53 @@


##@ Utility
.PHONY: help
help: ## Display this help
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make <target>\033[36m\033[0m\n"} /^[a-zA-Z_-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)


.PHONY: venv
venv:
pip install -U pip setuptools wheel pipenv
uv: ## Install uv
curl -LsSf https://astral.sh/uv/install.sh | sh

.PHONY: dev
dev:
pipenv install --dev
dev: ## Install dev dependencies
uv sync --dev

.PHONY: install
install:
pipenv install --skip-lock
install: ## Install dependencies
uv sync

.PHONY: test
test:
pipenv run pytest
test: ## Run tests
uv run pytest

.PHONY: lint
lint:
pipenv run flake8 src
pipenv run pydocstyle --match='(?!test_|_version).*\.py' --convention=numpy src
lint: ## Run linters
uv run ruff check ./src ./tests

.PHONY: fix
fix:
pipenv run black -l79 ./ineqpy/
fix: ## Fix lint errors
uv run ruff check ./src ./tests --fix

.PHONY: cov
cov: ## Run tests with coverage
uv run pytest --cov=src --cov-report=term-missing

.PHONY: pages
pages: doc
pages: doc ## Build documentation and push to gh-pages
mkdir gh-pages
touch gh-pages/.nojekyll
cp -r docs/build/html/* gh-pages/

.PHONY: doc
doc:
cd docs && pipenv run make html

.PHONY: vim
vim:
pipenv run nvim .
doc: ## Build documentation
cd docs && uv run make html

.PHONY: build
build:
python setup.py sdist bdist_wheel
build: ## Build package
uv build

docker:
docker run -v ${PWD}:/git/$(shell basename ${PWD}) -w /git/$(shell basename ${PWD}) -it python:3.9 /bin/bash
.PHONY: dbash
dbash: ## Run docker
docker run -v ${PWD}:/git/$(shell basename ${PWD}) -w /git/$(shell basename ${PWD}) -it python:3.12 /bin/bash
30 changes: 0 additions & 30 deletions Pipfile

This file was deleted.

Loading
Loading