Skip to content
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

Change build backend from flit to hatchling #127

Merged
merged 6 commits into from
Feb 10, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -154,3 +154,6 @@ cython_debug/

# rever
rever/

# setuptools_scm
_version.py
12 changes: 11 additions & 1 deletion conda_libmamba_solver/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
# Copyright (C) 2022 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
__version__ = "22.8.1"

try:
from ._version import version as __version__
except ImportError:
try:
from importlib_metadata import version

__version__ = version("conda_libmamba_solver")
del version
except ImportError:
__version__ = "0.0.0.unknown"

from warnings import warn as _warn

Expand Down
3 changes: 1 addition & 2 deletions dev/bashrc_linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,11 @@ restore_e() {
trap restore_e EXIT

sudo /opt/conda/condabin/conda install -y -p /opt/conda \
"flit-core>=3.2,<4" \
--file /opt/conda-libmamba-solver-src/dev/requirements.txt \
--file /opt/conda-libmamba-solver-src/tests/requirements.txt

cd /opt/conda-libmamba-solver-src
sudo env FLIT_ROOT_INSTALL=1 /opt/conda/bin/python -m flit install --symlink --deps=none
sudo /opt/conda/bin/python -m pip install -e . --no-deps

cd /opt/conda-src
export RUNNING_ON_DEVCONTAINER=${RUNNING_ON_DEVCONTAINER:-}
Expand Down
7 changes: 5 additions & 2 deletions dev/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
libmambapy>=1.0
libarchive
# build-time
pip
# run-time
conda>=22.9 # should be 22.11
importlib-metadata
libarchive
libmambapy>=1.0
19 changes: 19 additions & 0 deletions news/127-hatchling
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
### Enhancements

* <news item>

### Bug fixes

* <news item>

### Deprecations

* <news item>

### Docs

* <news item>

### Other

* Change the build-system to `hatchling` + `hatch-cvs` for a `setuptools-scm`-like versioning setup. (#128 via #127)
8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[build-system]
requires = ["flit_core >=3.2,<4"]
build-backend = "flit_core.buildapi"
requires = ["hatchling", "hatch-vcs"]
build-backend = "hatchling.build"

[project]
name = "conda-libmamba-solver"
Expand Down Expand Up @@ -37,8 +37,8 @@ homepage = "https://github.com/conda/conda-libmamba-solver"
[project.entry-points.conda]
conda-libmamba-solver = "conda_libmamba_solver.plugin"

[tool.flit.module]
name = "conda_libmamba_solver"
[tool.hatch.version]
source = "vcs"

[tool.black]
line-length = 99
Expand Down
9 changes: 8 additions & 1 deletion recipe/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package:
name: "conda-libmamba-solver"
version: {{ GIT_DESCRIBE_TAG }}.{{ GIT_BUILD_STR }}
version: "{{ GIT_DESCRIBE_TAG }}.{{ GIT_BUILD_STR }}"

source:
# git_url is nice in that it won't capture devenv stuff. However, it only
Expand Down Expand Up @@ -28,6 +28,13 @@ test:
- conda_libmamba_solver
commands:
- CONDA_SOLVER=libmamba conda create -n test --dry-run scipy
- >-
python -c
"import conda_libmamba_solver as cls;
from importlib.metadata import version;
assert '{{ PKG_VERSION }}' == cls.__version__ == version('conda_libmamba_solver'),
'{{ PKG_VERSION }}' + f', {cls.__version__}, ' + version('conda_libmamba_solver')
"

about:
home: https://github.com/conda/conda-libmamba-solver
Expand Down