diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index f77ea93..52a03bf 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -22,16 +22,15 @@ jobs: steps: - uses: actions/checkout@v3 - - name: Setup conda - uses: conda-incubator/setup-miniconda@v3 - with: - auto-update-conda: true - python-version: ${{ matrix.python-version }} - environment-file: conda-env.yml - channels: conda-forge - - name: Install pytest - run: | - conda install pytest --yes + + - name: Install uv + uses: astral-sh/setup-uv@v2 + + - name: Set up Python ${{ matrix.python-version }} + run: uv python install ${{ matrix.python-version }} + + - name: Install the project + run: uv sync --dev + - name: Run tests - run: | - python -m pytest + run: uv run pytest diff --git a/.gitignore b/.gitignore index 044ba5f..e2e35ba 100644 --- a/.gitignore +++ b/.gitignore @@ -161,3 +161,6 @@ cython_debug/ # macOS .DS_Store + +# uv +uv.lock diff --git a/.python-version b/.python-version new file mode 100644 index 0000000..e4fba21 --- /dev/null +++ b/.python-version @@ -0,0 +1 @@ +3.12 diff --git a/README.md b/README.md index 11b4064..fcd1a4b 100644 --- a/README.md +++ b/README.md @@ -11,8 +11,10 @@ Once you have a terminal (or "Anaconda prompt" on Windows) open after installati 1. Change to a directory where you want to download this code. 2. `git clone https://github.com/HiPCTProject/rebin` 3. `cd rebin` -4. `conda env create -f conda-env.yml` +4. `conda env create --name rebin` 5. `conda activate rebin` +6. `conda install uv` +7. `uv sync` Now you should be able to run the rebinning code using the example below. diff --git a/conda-env.yml b/conda-env.yml deleted file mode 100644 index 21ed59f..0000000 --- a/conda-env.yml +++ /dev/null @@ -1,9 +0,0 @@ -name: rebin -channels: - - conda-forge -dependencies: - - click - - dask - - glymur - - numpy - - scikit-image diff --git a/pyproject.toml b/pyproject.toml index da503bc..4dc1dae 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,12 +1,19 @@ -[tool.mypy] -ignore_missing_imports = true -no_implicit_optional = false +[project] +name = "rebin" +version = "0.1.0" +description = "Re-bin JPEG2000 images" +readme = "README.md" +requires-python = ">=3.9" +dependencies = [ + "click", + "dask", + "glymur", + "joblib", + "numpy", + "scikit-image", +] -[tool.ruff] -fix = true -force-exclude = true -select = [ - "F401", # Remove unused imports - "I", # Sort imports - "UP", # Update Python syntax +[tool.uv] +dev-dependencies = [ + "pytest", ] diff --git a/requirements-dev.txt b/requirements-dev.txt deleted file mode 100644 index 26b77f6..0000000 --- a/requirements-dev.txt +++ /dev/null @@ -1,2 +0,0 @@ --r requirements.txt -pytest diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 03674a1..0000000 --- a/requirements.txt +++ /dev/null @@ -1,5 +0,0 @@ -click -dask -glymur -numpy -scikit-image