Skip to content

Commit

Permalink
Move from poetry and just to pixi (#595)
Browse files Browse the repository at this point in the history
  • Loading branch information
s3alfisc authored Sep 27, 2024
1 parent ac2567b commit ea12dd2
Show file tree
Hide file tree
Showing 24 changed files with 16,834 additions and 5,325 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# GitHub syntax highlighting
pixi.lock linguist-language=YAML linguist-generated=true
109 changes: 44 additions & 65 deletions .github/workflows/ci-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,11 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- name: Set up poetry
uses: snok/install-poetry@v1
- name: Install
run: poetry install --without docs

- uses: prefix-dev/[email protected]
with:
pixi-version: v0.29.0
cache: true

- name: set numba parallel flags
run: |
Expand All @@ -39,13 +40,21 @@ jobs:
- name: Setup r2u
uses: eddelbuettel/github-actions/r2u-setup@master

- name: install R packages
run: Rscript -e 'install.packages(c("fixest", "broom", "did2s", "clubSandwich", "wildrwolf", "ivDiag"))'
shell: bash
- name: Print R version
run: |
Rscript -e 'R.version'
- name: Install R packages
run: |
R_LIB_PATH="${{ github.workspace }}/.pixi/envs/dev/lib/R/library"
mkdir -p $R_LIB_PATH
Rscript -e ".libPaths('$R_LIB_PATH'); install.packages(c('fixest', 'broom', 'did2s', 'wildrwolf', 'ivDiag', 'car'), lib='/home/runner/work/pyfixest/pyfixest/.pixi/envs/dev/lib/R/library')"
Rscript -e ".libPaths('$R_LIB_PATH'); install.packages('ritest', lib='/home/runner/work/pyfixest/pyfixest/.pixi/envs/dev/lib/R/library', repos = c('https://grantmcdermott.r-universe.dev'))"
- name: Run tests
- name: Run 'regular 'tests
run: |
poetry run pytest tests -m "not (extended or slow or plots)" --cov=pyfixest --cov-report=xml
pixi run tests-regular
- name: Upload to Codecov
uses: codecov/codecov-action@v4
with:
Expand All @@ -71,10 +80,12 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- name: Set up poetry
uses: snok/install-poetry@v1
- name: Install
run: poetry install --without docs

- uses: prefix-dev/[email protected]
with:
pixi-version: v0.29.0
cache: true


- name: set numba parallel flags
run: |
Expand All @@ -83,13 +94,16 @@ jobs:
- name: Setup r2u
uses: eddelbuettel/github-actions/r2u-setup@master

- name: install R packages
run: Rscript -e 'install.packages(c("fixest", "broom", "did2s", "clubSandwich", "wildrwolf", "ivDiag"))'
shell: bash
- name: Install R packages
run: |
R_LIB_PATH="${{ github.workspace }}/.pixi/envs/dev/lib/R/library"
mkdir -p $R_LIB_PATH
Rscript -e ".libPaths('$R_LIB_PATH'); install.packages(c('fixest', 'broom','did2s', 'wildrwolf', 'ivDiag', 'car'), lib='/home/runner/work/pyfixest/pyfixest/.pixi/envs/dev/lib/R/library')"
Rscript -e ".libPaths('$R_LIB_PATH'); install.packages('ritest', lib='/home/runner/work/pyfixest/pyfixest/.pixi/envs/dev/lib/R/library', repos = c('https://grantmcdermott.r-universe.dev'))"
- name: Run tests
- name: Run 'slow 'tests
run: |
poetry run pytest tests -m slow --cov=./ --cov-report=xml
pixi run tests-slow
#- name: Upload to Codecov
# uses: codecov/codecov-action@v4
Expand All @@ -99,47 +113,6 @@ jobs:
# flags: tests-vs-fixest


test_notebooks:
name: "Test Notebooks"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: "3.12"

- name: Set up poetry
uses: snok/install-poetry@v1

- name: Install dependencies
run: poetry install

- name: Set up poetry
uses: snok/install-poetry@v1

- name: Install
run: poetry install --without docs
- name: set numba parallel flags
run: |
echo "NUMBA_NUM_THREADS=1" >> $GITHUB_ENV
- name: Setup r2u
uses: eddelbuettel/github-actions/r2u-setup@master

- name: install R packages
run: Rscript -e 'install.packages(c("fixest", "broom", "did2s", "clubSandwich", "wildrwolf", "ivDiag"))'
shell: bash

- name: Install TeXlive
run: sudo apt-get update && sudo apt-get install texlive texlive-publishers texlive-science latexmk cm-super

- name: Run notebooks
run: |
poetry install --with docs
poetry run python scripts/run_notebooks.py

build-docs:
name: "Build Docs"
Expand All @@ -152,26 +125,32 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Set up poetry
uses: snok/install-poetry@v1
- name: Install dependencies
run: poetry install --with docs

- uses: prefix-dev/[email protected]
with:
pixi-version: v0.29.0
cache: true

- name: Set up Quarto
uses: quarto-dev/quarto-actions/setup@v2

- name: install tinytex
run: |
quarto install tinytex
- name: Compile docstrings with quartodoc
run : |
poetry run quartodoc build --verbose --config docs/_quarto.yml
pixi run docs-build
- name: Render docs
run: |
poetry run quarto render docs
pixi run docs-render
- name: Save docs artifact
uses: actions/upload-artifact@v4
with:
name: docs-html
path: docs/_site


publish-docs:
name: "Publish Docs"
runs-on: ubuntu-latest
Expand Down
24 changes: 12 additions & 12 deletions .github/workflows/extended-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,10 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

# Set up poetry (common to both scenarios)
- name: Set up poetry
uses: snok/install-poetry@v1

# Install dependencies (common to both scenarios)
- name: Install dependencies
run: poetry install --without docs
- uses: prefix-dev/[email protected]
with:
pixi-version: v0.29.0
cache: true

# Set numba parallel flags (common to both scenarios)
- name: Set numba parallel flags
Expand All @@ -46,16 +43,19 @@ jobs:
- name: Setup r2u
uses: eddelbuettel/github-actions/r2u-setup@master

- name: install R packages
run: Rscript -e 'install.packages(c("fixest", "broom", "did2s", "clubSandwich", "wildrwolf", "ivDiag"))'
shell: bash
- name: Install R packages
run: |
R_LIB_PATH="${{ github.workspace }}/.pixi/envs/dev/lib/R/library"
mkdir -p $R_LIB_PATH
Rscript -e ".libPaths('$R_LIB_PATH'); install.packages(c('fixest', 'broom','clubSandwich', 'did2s', 'wildrwolf', 'ivDiag', 'car'), lib='/home/runner/work/pyfixest/pyfixest/.pixi/envs/dev/lib/R/library')"
Rscript -e ".libPaths('$R_LIB_PATH'); install.packages('ritest', lib='/home/runner/work/pyfixest/pyfixest/.pixi/envs/dev/lib/R/library', repos = c('https://grantmcdermott.r-universe.dev', 'https://cloud.r-project.org'))"
# Run tests for PRs with the label "extended"
- name: Run tests for plots (only on PRs with the 'tests-extended' label)
if: github.event_name == 'pull_request' && contains(github.event.label.name, 'tests-extended')
run: poetry run pytest tests -m "extended" --cov=pyfixest --cov-report=xml
run: pixi run tests-extended

# Run tests for push to master
- name: Run tests for push to master
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
run: poetry run pytest tests -m "extended" --cov=pyfixest --cov-report=xml
run: pixi run tests-extended
22 changes: 8 additions & 14 deletions .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,14 @@ jobs:
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install pypa/build
run: >-
python -m
pip install
build
--user
- name: Build a binary wheel and a source tarball
run: >-
python -m
build
--sdist
--wheel
--outdir dist/
python-version: '3.11'
- uses: prefix-dev/[email protected]
with:
pixi-version: v0.29.0
cache: true
- name: Install R packages
run: |
pixi run build-pip
- name: Publish distribution 📦 to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
Expand Down
8 changes: 6 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,9 @@ readme.ipynb
#docs/site_libs
#site_libs
tests/.coverage
.venv/
docs/regression-compression.ipynb
.venv/# pixi environments
.pixi
*.egg-info
# pixi environments
.pixi
*.egg-info
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ repos:
args: [--allow-multiple-documents]
- id: check-toml
- id: check-added-large-files

exclude: pixi.lock
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.29.2
hooks:
Expand Down
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,18 @@

# PyFixest: Fast High-Dimensional Fixed Effects Regression in Python

[![License](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/license/mit)
[![PyPI -Version](https://img.shields.io/pypi/v/pyfixest.svg)](https://pypi.org/project/pyfixest/)
[![License](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/license/mit)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/pyfixest.svg)
[![Downloads](https://static.pepy.tech/badge/pyfixest)](https://pepy.tech/project/pyfixest)
[![Downloads](https://static.pepy.tech/badge/pyfixest/month)](https://pepy.tech/project/pyfixest)
[![PyPI -Version](https://img.shields.io/pypi/v/pyfixest.svg)](https://pypi.org/project/pyfixest/)
[![image](https://codecov.io/gh/py-econometrics/pyfixest/branch/master/graph/badge.svg)](https://codecov.io/gh/py-econometrics/pyfixest)
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
[![All Contributors](https://img.shields.io/badge/all_contributors-5-orange.svg?style=flat-square)](#contributors-)
[![Pixi Badge][pixi-badge]][pixi-url]
[![All Contributors](https://img.shields.io/badge/all_contributors-18-green.svg?style=flat-square)](#contributors-)
[![Downloads](https://static.pepy.tech/badge/pyfixest)](https://pepy.tech/project/pyfixest)
[![Downloads](https://static.pepy.tech/badge/pyfixest/month)](https://pepy.tech/project/pyfixest)

[pixi-badge]:https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/prefix-dev/pixi/main/assets/badge/v0.json&style=flat-square
[pixi-url]: https://pixi.sh

`PyFixest` is a Python implementation of the formidable [fixest](https://github.com/lrberge/fixest) package for fast high-dimensional fixed effects regression.

Expand Down
Loading

0 comments on commit ea12dd2

Please sign in to comment.