diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml deleted file mode 100644 index e93ec77..0000000 --- a/.github/workflows/continuous-integration.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: "Continuous Integration" -run-name: Running tests on "${{ github.ref }}" by "${{ github.actor }}" -on: - push: - branches: - - 'main' - pull_request: - types: - - opened - - reopened - - synchronize - workflow_dispatch: - -jobs: - # Run pre-commit hooks - pre-commit: - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v4 - - uses: astral-sh/setup-uv@v5 - - run: uv sync - - run: uv run pre-commit run --all-files - # Run tests - tests: - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v4 - - uses: astral-sh/setup-uv@v5 - - run: uv sync - - run: uv run pytest diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml new file mode 100644 index 0000000..d96c4c6 --- /dev/null +++ b/.github/workflows/deployment.yml @@ -0,0 +1,63 @@ +name: "Deployment" +run-name: Running on "${{ github.ref }}" by "${{ github.actor }}" +on: + push: + branches: + - 'main' + pull_request: + types: + - opened + - reopened + - synchronize + workflow_dispatch: + +jobs: + # Run pre-commit hooks + pre-commit: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + - uses: astral-sh/setup-uv@v5 + - run: uv sync --all-extras + - run: uv run pre-commit run --all-files + # Run tests + tests: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + - uses: astral-sh/setup-uv@v5 + - run: uv sync --all-extras + - run: uv run pytest + # Run build + build: + if: github.ref == 'refs/heads/main' + needs: + - pre-commit + - tests + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + - uses: astral-sh/setup-uv@v5 + - run: uv sync --all-extras + - run: uv build + - uses: actions/upload-artifact@v4 + with: + name: python-package-distributions + path: dist/ + # Run deploy + deploy: + if: github.ref == 'refs/heads/main' + needs: + - build + runs-on: ubuntu-22.04 + env: + UV_PUBLISH_TOKEN: ${{ secrets.UV_PUBLISH_TOKEN }} + steps: + - uses: actions/checkout@v4 + - uses: astral-sh/setup-uv@v5 + - uses: actions/download-artifact@v4 + with: + name: python-package-distributions + path: dist/ + - run: uv sync --all-extras + - run: uv publish --token $UV_PUBLISH_TOKEN diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 76c7886..0f88086 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,9 +5,7 @@ repos: hooks: - id: trailing-whitespace - id: end-of-file-fixer - - id: check-yaml - id: check-added-large-files - - id: check-json - id: check-ast - repo: https://github.com/astral-sh/ruff-pre-commit rev: v0.12.1 diff --git a/README.md b/README.md index caa5aa4..1cb4369 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![GitHub](https://img.shields.io/static/v1?label=Code&message=GitHub&color=blue&style=flat-square)](https://github.com/leomaurodesenv/scikit-sampling) [![MIT license](https://img.shields.io/static/v1?label=License&message=MIT&color=blue&style=flat-square)](LICENSE) -[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/leomaurodesenv/scikit-sampling/continuous-integration.yml?label=Build&style=flat-square)](https://github.com/leomaurodesenv/scikit-sampling/actions/workflows/continuous-integration.yml) +[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/leomaurodesenv/scikit-sampling/deployment.yml?label=Build&style=flat-square)](https://github.com/leomaurodesenv/scikit-sampling/actions/workflows/deployment.yml) Scikit-Sampling (or `sksampling`) is a Python library for dataset sampling techniques. It provides a unified API for common sampling strategies, making it easy to integrate into your data science and machine learning workflows. diff --git a/pyproject.toml b/pyproject.toml index 84af741..9790530 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,11 +1,15 @@ +[build-system] +requires = ["setuptools>=80.9.0"] +build-backend = "setuptools.build_meta" + [project] name = "scikit-sampling" license = "MIT" +license-files = ["LICENSE"] readme = "README.md" version = "0.1.0" requires-python = ">=3.10" description = "A set of python modules for dataset sampling" -url = "https://github.com/leomaurodesenv/scikit-sampling" authors = [ {name = "Leonardo Moraes", email = "leomaurodesenv@users.noreply.github.com"} ] @@ -15,7 +19,6 @@ classifiers=[ "Programming Language :: Python", "Topic :: Scientific/Engineering", "Development Status :: 4 - Beta", - "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", @@ -27,6 +30,11 @@ dependencies = [ "scipy>=1.15.0,<2", ] +[project.optional-dependencies] +build = [ + "setuptools>=80.9.0,<90", +] + [dependency-groups] dev = [ "commitizen>=4.8.3,<5", diff --git a/uv.lock b/uv.lock index 9cd9e3c..45fd73f 100644 --- a/uv.lock +++ b/uv.lock @@ -615,12 +615,17 @@ wheels = [ [[package]] name = "scikit-sampling" version = "0.1.0" -source = { virtual = "." } +source = { editable = "." } dependencies = [ { name = "scipy", version = "1.15.3", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.11'" }, { name = "scipy", version = "1.16.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.11'" }, ] +[package.optional-dependencies] +build = [ + { name = "setuptools" }, +] + [package.dev-dependencies] dev = [ { name = "commitizen" }, @@ -630,7 +635,11 @@ dev = [ ] [package.metadata] -requires-dist = [{ name = "scipy", specifier = ">=1.15.0,<2" }] +requires-dist = [ + { name = "scipy", specifier = ">=1.15.0,<2" }, + { name = "setuptools", marker = "extra == 'build'", specifier = ">=80.9.0,<90" }, +] +provides-extras = ["build"] [package.metadata.requires-dev] dev = [ @@ -749,6 +758,15 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/eb/c4/231cac7a8385394ebbbb4f1ca662203e9d8c332825ab4f36ffc3ead09a42/scipy-1.16.0-cp313-cp313t-win_amd64.whl", hash = "sha256:f56296fefca67ba605fd74d12f7bd23636267731a72cb3947963e76b8c0a25db", size = 38515076, upload-time = "2025-06-22T16:21:45.694Z" }, ] +[[package]] +name = "setuptools" +version = "80.9.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/18/5d/3bf57dcd21979b887f014ea83c24ae194cfcd12b9e0fda66b957c69d1fca/setuptools-80.9.0.tar.gz", hash = "sha256:f36b47402ecde768dbfafc46e8e4207b4360c654f1f3bb84475f0a28628fb19c", size = 1319958, upload-time = "2025-05-27T00:56:51.443Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/a3/dc/17031897dae0efacfea57dfd3a82fdd2a2aeb58e0ff71b77b87e44edc772/setuptools-80.9.0-py3-none-any.whl", hash = "sha256:062d34222ad13e0cc312a4c02d73f059e86a4acbfbdea8f8f76b28c99f306922", size = 1201486, upload-time = "2025-05-27T00:56:49.664Z" }, +] + [[package]] name = "termcolor" version = "3.1.0"