diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9811dc7da..421053b1b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -152,82 +152,96 @@ jobs: - ubuntu-latest - macos-latest steps: - - name: Check out source + - name: 📥 Check out source uses: actions/checkout@v4 with: fetch-depth: 0 - - name: Set up Python + - name: 🐍 Set up Python uses: actions/setup-python@v5 id: pyinstall with: python-version: ${{matrix.python}} cache: 'pip' - - name: Install build tools + - name: 🛠️ Install build tools run: | - "$PYTHON" -m pip install -U 'uv>=0.1.15' + "$PYTHON" -m pip install -U pdm env: PYTHON: ${{ steps.pyinstall.outputs.python-path }} - - name: Set up Python deps - run: uv pip install --python "$PYTHON" -e '.[test]' - env: - PYTHON: ${{ steps.pyinstall.outputs.python-path }} + - name: 📦 Set up Python deps + run: | + pdm venv create "${{matrix.python}}" + pdm lock -S no_cross_platform + pdm install -dG test -v - - name: Inspect environment + - name: 🔍 Inspect environment run: | - pip list + pdm info + pdm list - - name: Run tests + - name: 🏃🏽‍♀️‍➡️ Run tests run: | - "$PYTHON" -m pytest --cov=lenskit --cov-report=xml --log-file=test.log - env: - PYTHON: ${{ steps.pyinstall.outputs.python-path }} + pdm run python -m pytest --cov=lenskit --cov-report=xml --log-file=test.log - - name: Process test results - uses: lenskit/lkbuild/actions/save-test-results@main + - name: 🥼 Aggreagate coverage data + run: pdm run coverage xml + + - name: 🪵 Upload logs + uses: actions/upload-artifact@v3 with: - artifact-name: test-vanilla-${{matrix.platform}}-py${{matrix.python}} + name: test-vanilla-${{matrix.platform}}-py${{matrix.python}} + path: | + test*.log + coverage.xml mindep: name: Minimal Supported Dependencies runs-on: ubuntu-latest steps: - - name: Check out source + - name: 📥 Check out source uses: actions/checkout@v4 with: fetch-depth: 0 - - name: Set up Python + - name: 🐍 Set up Python uses: actions/setup-python@v5 id: pyinstall with: python-version: '3.10' - - name: Install build tools + - name: 🛠️ Install build tools run: | - "$PYTHON" -m pip install -U 'uv>=0.1.15' + "$PYTHON" -m pip install -U pdm env: PYTHON: ${{ steps.pyinstall.outputs.python-path }} - - name: Set up Python deps - run: uv pip install --python "$PYTHON" --resolution=lowest-direct -e '.[test]' - env: - PYTHON: ${{ steps.pyinstall.outputs.python-path }} + - name: 📦 Set up Python deps + run: | + pdm venv create 3.10 + pdm lock -S direct_minimal_versions -S no_cross_platform + pdm install -dG test - - name: Inspect environment + - name: 🔍 Inspect environment run: | - pip list + pdm info + pdm list - - name: Run tests + - name: 🏃🏽‍♀️‍➡️ Run tests run: | - python -m pytest --cov=lenskit --cov-report=xml --log-file test.log + pdm run python -m pytest --cov=lenskit --cov-report=xml --log-file=test.log - - name: Process Test Results - uses: lenskit/lkbuild/actions/save-test-results@main + - name: 🥼 Aggreagate coverage data + run: pdm run coverage xml + + - name: 🪵 Upload logs + uses: actions/upload-artifact@v3 with: - artifact-name: test-mindeps + name: test-vanilla-min-deps + path: | + test*.log + coverage.xml results: name: Test Suite Results diff --git a/.gitignore b/.gitignore index 4e8519b84..ceb99646f 100644 --- a/.gitignore +++ b/.gitignore @@ -42,6 +42,13 @@ lenskit/**/*.c conda-lock.yml *.lock *.lock.yml +pdm.lock +.pdm-build/ +.pdm-plugins/ + +# ignore local pdm config +.pdm-python +pdm.toml # Editor and OS cruft .DS_Store diff --git a/pyproject.toml b/pyproject.toml index 8094c46f2..b449de965 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [build-system] -requires = ["setuptools>=64", "setuptools_scm>=8"] -build-backend = "setuptools.build_meta" +requires = ["pdm-backend"] +build-backend = "pdm.backend" [project] name = "lenskit" @@ -23,7 +23,7 @@ license = { file = "LICENSE.md" } dynamic = ["version"] dependencies = [ "pandas >=1.5, <3", - "numpy >= 1.23", + "numpy >= 1.23,<2", "scipy >= 1.9.0", "numba >= 0.56, < 0.59", "torch ~=2.1", # p2c: -s pytorch==2.* @@ -36,6 +36,32 @@ dependencies = [ ] [project.optional-dependencies] +sklearn = ["scikit-learn >= 1.1"] + +[project.urls] +homepage = "https://lenskit.org" +documentation = "https://lkpy.lenskit.org" +source = "https://github.com/lenskit/lkpy" + +# configure build tools +[tool.pdm] +distribution = true + +[tool.pdm.version] +source = "scm" + +[tool.pdm.build] +includes = [ + "lenskit", +] +source-includes = [ + "CITATION.cff", + "tests/*", + "docs/*", + "conftest.py", +] + +[tool.pdm.dev-dependencies] dev = [ "setuptools>=64", "setuptools_scm>=8", @@ -71,32 +97,36 @@ demo = [ "nbformat >=5.2", "ipython >= 7", ] -sklearn = ["scikit-learn >= 1.1"] -[project.urls] -homepage = "https://lenskit.org" -documentation = "https://lkpy.lenskit.org" -source = "https://github.com/lenskit/lkpy" - -# configure build tools -[tool.flit.sdist] -include = ["tests/*"] -exclude = [ - ".github", - "*.ipynb", - "docs", - "data", - "examples", - "build-tools", - "lkbuild", - "tasks.py", +[tool.pdm.conda] +solver = "libmamba" +as-default-manager = true +# auto-excludes = true +runner = "conda" +batched-commands = true +channels = [ + "conda-forge", + "pytorch", + "nodefaults", +] +dependencies = [ + "tbb", +] +excludes = [ + "manylog", + "progress-api", + "seedbank", + "unbeheader", ] -[tool.setuptools] -packages = ["lenskit"] +[tool.pdm.conda.pypi-mapping] +download-dir = "/tmp" + +[tool.pdm.conda.dev-dependencies] +dev = [ + "just==1.*", +] -[tool.setuptools_scm] -version_scheme = "release-branch-semver" # settings for generating conda environments for dev & CI, when needed [tool.pyproject2conda]