Skip to content

Commit

Permalink
Merge pull request #108 from zuzukin/python-3.12
Browse files Browse the repository at this point in the history
Python 3.12
  • Loading branch information
analog-cbarber committed Oct 8, 2023
2 parents 384bf32 + 3463d86 commit e64c0b4
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 36 deletions.
13 changes: 9 additions & 4 deletions .github/workflows/python-package-conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,25 @@ jobs:
fail-fast: true
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.8", "3.10", "3.11"]
python-version: ["3.8", "3.10", "3.12"]
steps:
- uses: actions/checkout@v3
- uses: goanpeca/setup-miniconda@v2.2.0
with:
miniforge-variant: Mambaforge-pypy3
miniforge-version: latest
conda-version: ">=23.7.4"
# auto-update-conda: true
conda-build-version: ">=3.26"
environment-file: environment.yml
activate-environment: whl2conda-dev
python-version: ${{ matrix.python-version }}
auto-update-conda: true
condarc-file: github-condarc.yml
auto-activate-base: true
condarc-file: github-condarc.yml
use-mamba: true
- name: show conda versions
run: |
conda list -n base conda
conda list -n base mamba
- name: Dev install whl2conda
run: |
conda run -n whl2conda-dev pip install -e . --no-deps --no-build-isolation
Expand Down
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ help:
DEV_INSTALL := $(CONDA_RUN) pip install -e . --no-deps --no-build-isolation

createdev:
conda env create -f environment.yml -n $(DEV_ENV) --yes
conda create -n $(DEV_ENV) python=3.12 --yes
conda env update -f environment.yml -n $(DEV_ENV)
$(MAKE) dev-install

updatedev:
Expand Down
7 changes: 5 additions & 2 deletions conda.recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,21 @@ build:

requirements:
build:
- python 3.11
- python 3.12
- hatchling
- setuptools


run:
- python {{ project['requires-python'] }}

{% for dep in project['dependencies'] %}
- {{ dep.lower() }}
{% endfor %}

whl2conda:
something:
- foo
- bar

test:
source_files:
Expand Down
9 changes: 3 additions & 6 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ channels:
- conda-forge
- garpy # for mkdocstrings-python-xref
dependencies:
- python >=3.8,<3.12
- python >=3.8,<3.13
# runtime
- conda-package-handling >=2.2,<3.0
- platformdirs >=3.10
Expand All @@ -16,12 +16,12 @@ dependencies:
- make >=4.3
# testing
- mypy >=1.5,<2.0
- pylint >=2.17,<3.0
- pylint >=2.17
- pytest >=7.4,<8.0
- pytest-cov >=4.1.0,<5.0
- types-pyyaml >=6.0
# documentation
- black >=23.7
- black >=22.6
- mike >=1.1,<2.0
- mkdocs >=1.5,<2.0
- mkdocstrings-python >=1.3,<2.0
Expand All @@ -34,6 +34,3 @@ dependencies:
- pip >=23.2.1
- pip:
- mkdocs-awesome-pages-plugin >=2.9.2



5 changes: 5 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ classifiers = [
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]
keywords = ["conda", "wheel", "build"]
requires-python = ">=3.8"
Expand Down Expand Up @@ -92,6 +93,9 @@ max-returns = 6
max-statements = 50
min-public-methods = 1

[tool.pylint.similarities]
min-similarity-lines = 6

[tool.pylint.variables]
allowed-redefined-builtins = ["help", "license"]

Expand All @@ -105,6 +109,7 @@ disable = [
"locally-disabled",
"raw-checker-failed",
"suppressed-message",
"too-many-arguments",
"trailing-newlines",
"unspecified-encoding",
"use-dict-literal",
Expand Down
17 changes: 8 additions & 9 deletions src/whl2conda/cli/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,14 @@ def build_main(
parser = argparse.ArgumentParser(
description=dedent(
"""
Compare the content of two conda packages
This will unpack each conda packaeg into temporary
directories, normalize the layout of files in the
input directory to minimize line differences, and
will run the specified diff tool and arguments.
This can be used to compare packages generated using
this tool against those created using conda-build.
Build a conda package from a pure python wheel.
This command is limited drop-in replacement for `conda build`.
It requires that the conda recipe has a build script entry
of the form `pip install` or `pip wheel`.
This is an experimental feature and is still under active
change and development.
"""
),
formatter_class=argparse.RawTextHelpFormatter,
Expand Down
17 changes: 3 additions & 14 deletions src/whl2conda/cli/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

from conda_package_handling.api import extract as extract_conda_pkg

from .common import dedent, existing_path, add_markdown_help
from .common import dedent, existing_path, add_markdown_help, get_conda_bld_path

__all__ = ["install_main"]

Expand Down Expand Up @@ -202,17 +202,7 @@ def install_main(

def conda_bld_install(parsed: InstallArgs, subdir: str):
"""Install package into conda-bld directory"""
config = json.loads(
subprocess.check_output(
["conda", "config", "--show", "--json"],
encoding="utf8",
)
)
conda_bld = config.get("bld_path") or config.get("croot")
if not conda_bld: # pragma: no cover
# this is extremely unlikely to ever occur
raise LookupError("Cannot find conda-bld location")
conda_bld_path = Path(conda_bld)
conda_bld_path = get_conda_bld_path()
subdir_path = conda_bld_path.joinpath(subdir) # e.g. noarch/

print(f"Installing {parsed.package_file} into {subdir_path}")
Expand All @@ -221,9 +211,8 @@ def conda_bld_install(parsed: InstallArgs, subdir: str):
shutil.copyfile(
parsed.package_file, subdir_path.joinpath(parsed.package_file.name)
)
# TODO: use conda-index instead
subprocess.check_call(
["conda", "index", str(conda_bld_path), "--subdir", subdir]
["conda", "index", "--subdir", subdir, str(conda_bld_path)]
)


Expand Down
1 change: 1 addition & 0 deletions test/api/test_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,7 @@ def test_overwrite_prompt(
prompts: Iterator[str] = iter(())
responses: Iterator[str] = iter(())

# pylint: disable=duplicate-code
def fake_input(prompt: str) -> str:
expected_prompt = next(prompts)
assert re.search(
Expand Down

0 comments on commit e64c0b4

Please sign in to comment.