diff -Nru conda-package-handling-2.0.1/AUTHORS.md conda-package-handling-2.1.0/AUTHORS.md --- conda-package-handling-2.0.1/AUTHORS.md 2022-11-21 11:28:24.000000000 +0000 +++ conda-package-handling-2.1.0/AUTHORS.md 2023-05-04 18:42:17.000000000 +0000 @@ -21,3 +21,4 @@ * Ray Donnelly * Tobias "Tobi" Koch * Vadim Zayakin +* pre-commit-ci[bot] diff -Nru conda-package-handling-2.0.1/.authors.yml conda-package-handling-2.1.0/.authors.yml --- conda-package-handling-2.0.1/.authors.yml 2022-11-21 11:28:24.000000000 +0000 +++ conda-package-handling-2.1.0/.authors.yml 2023-05-04 18:42:17.000000000 +0000 @@ -8,7 +8,7 @@ aliases: - Mike Sarahan - Michael Sarahan - num_commits: 194 + num_commits: 149 first_commit: 2019-01-03 20:00:40 - name: Nehal J Wani email: nehaljw.kkd1@gmail.com @@ -56,12 +56,12 @@ github: seemethere - name: Daniel Bast email: 2790401+dbast@users.noreply.github.com - num_commits: 2 + num_commits: 3 first_commit: 2021-04-12 11:49:45 github: dbast - name: Conda Bot email: 18747875+conda-bot@users.noreply.github.com - num_commits: 26 + num_commits: 17 first_commit: 2022-01-17 20:22:29 github: conda-bot aliases: @@ -86,7 +86,7 @@ first_commit: 2022-02-17 10:23:53 - name: Daniel Holth email: dholth@anaconda.com - num_commits: 17 + num_commits: 21 first_commit: 2021-08-20 21:11:50 github: dholth - name: Vadim Zayakin @@ -119,3 +119,8 @@ num_commits: 5 first_commit: 2022-06-15 15:11:13 github: kenodegard +- name: pre-commit-ci[bot] + email: 66853113+pre-commit-ci[bot]@users.noreply.github.com + github: pre-commit-ci[bot] + num_commits: 4 + first_commit: 2023-01-20 04:55:56 diff -Nru conda-package-handling-2.0.1/CHANGELOG.md conda-package-handling-2.1.0/CHANGELOG.md --- conda-package-handling-2.0.1/CHANGELOG.md 2022-11-21 11:28:24.000000000 +0000 +++ conda-package-handling-2.1.0/CHANGELOG.md 2023-05-04 18:42:17.000000000 +0000 @@ -1,5 +1,38 @@ [//]: # (current developments) +## 2.1.0 (2023-05-04) + +### Bug fixes + +* Include decompressed size when creating `.conda` archives with + `CondaFormat_v2.create()`, to reduce memory usage on decompression. (#171) + Transmuted archives (converted from `.tar.bz2`) do not contain the + decompressed size. +* Include LICENSE, not just LICENSE.txt in info/ section (#172) + +### Contributors + +* @conda-bot +* @dbast +* @dholth +* @pre-commit-ci[bot] + + + +## 2.0.2 (2022-12-01) + +### Bug fixes + +* Reduce memory usage when creating `.conda`. Allocate only one zstd comperssor + when creating `.conda`. Lower default compression level to 19 from 22. + (#168) + +### Contributors + +* @dholth + + + ## 2.0.1 (2022-11-18) ### Bug fixes diff -Nru conda-package-handling-2.0.1/CODE_OF_CONDUCT.md conda-package-handling-2.1.0/CODE_OF_CONDUCT.md --- conda-package-handling-2.0.1/CODE_OF_CONDUCT.md 2022-11-21 11:28:24.000000000 +0000 +++ conda-package-handling-2.1.0/CODE_OF_CONDUCT.md 2023-05-04 18:42:17.000000000 +0000 @@ -1,3 +1,20 @@ -# Code of Conduct +# Conda Organization Code of Conduct -This repo adheres to the [NumFOCUS Code of Conduct](https://www.numfocus.org/code-of-conduct). +> **Note** +> Below is the short version of our CoC, see the long version [here](https://github.com/conda-incubator/governance/blob/main/CODE_OF_CONDUCT.md). + +# The Short Version + +Be kind to others. Do not insult or put down others. Behave professionally. Remember that harassment and sexist, racist, or exclusionary jokes are not appropriate for the conda Organization. + +All communication should be appropriate for a professional audience including people of many different backgrounds. Sexual language and imagery is not appropriate. + +The conda Organization is dedicated to providing a harassment-free community for everyone, regardless of gender, sexual orientation, gender identity and expression, disability, physical appearance, body size, race, or religion. We do not tolerate harassment of community members in any form. + +Thank you for helping make this a welcoming, friendly community for all. + +## Report an Incident + +* Report a code of conduct incident [using a form](https://form.jotform.com/221527028480048). +* Report a code of conduct incident via email: [conduct@conda.org](mailto:conduct@conda.org). +* Contact [an individual committee member](#committee-membership) or [CoC event representative](#coc-representatives) to report an incident in confidence. diff -Nru conda-package-handling-2.0.1/debian/changelog conda-package-handling-2.1.0/debian/changelog --- conda-package-handling-2.0.1/debian/changelog 2023-01-01 04:17:00.000000000 +0000 +++ conda-package-handling-2.1.0/debian/changelog 2023-07-11 15:44:04.000000000 +0000 @@ -1,3 +1,10 @@ +conda-package-handling (2.1.0-1) unstable; urgency=medium + + * New upstream version + * Standards-Version: 4.6.2 (routine-update) + + -- Andreas Tille Tue, 11 Jul 2023 17:44:04 +0200 + conda-package-handling (2.0.1-2) unstable; urgency=medium * Team Upload. diff -Nru conda-package-handling-2.0.1/debian/control conda-package-handling-2.1.0/debian/control --- conda-package-handling-2.0.1/debian/control 2023-01-01 03:46:38.000000000 +0000 +++ conda-package-handling-2.1.0/debian/control 2023-07-11 15:44:04.000000000 +0000 @@ -14,7 +14,7 @@ python3-tqdm , python3-pytest-mock , python3-conda-package-streaming -Standards-Version: 4.6.1 +Standards-Version: 4.6.2 Vcs-Browser: https://salsa.debian.org/med-team/conda-package-handling Vcs-Git: https://salsa.debian.org/med-team/conda-package-handling.git Homepage: https://github.com/conda/conda-package-handling diff -Nru conda-package-handling-2.0.1/debian/patches/32-bit.patch conda-package-handling-2.1.0/debian/patches/32-bit.patch --- conda-package-handling-2.0.1/debian/patches/32-bit.patch 2023-01-01 04:16:36.000000000 +0000 +++ conda-package-handling-2.1.0/debian/patches/32-bit.patch 2023-07-11 15:44:04.000000000 +0000 @@ -1,6 +1,8 @@ Description: Set ZSTD_COMPRESS_LEVEL to 21 as zst compression consumes a lot of mem in 32 bit Author: Nilesh Patra -Last-Update: 2023-01-01 +Last-Update: 2023-07-11 +Comment: Deactivated since upstream has now set level 19 + --- a/src/conda_package_handling/conda_fmt.py +++ b/src/conda_package_handling/conda_fmt.py @@ -19,10 +19,10 @@ diff -Nru conda-package-handling-2.0.1/debian/patches/series conda-package-handling-2.1.0/debian/patches/series --- conda-package-handling-2.0.1/debian/patches/series 2023-01-01 04:15:38.000000000 +0000 +++ conda-package-handling-2.1.0/debian/patches/series 2023-07-11 15:44:04.000000000 +0000 @@ -1,4 +1,4 @@ #fix_linking.patch fix_test.patch skip-test-timeline.patch -32-bit.patch +#32-bit.patch diff -Nru conda-package-handling-2.0.1/debian/patches/skip-test-timeline.patch conda-package-handling-2.1.0/debian/patches/skip-test-timeline.patch --- conda-package-handling-2.0.1/debian/patches/skip-test-timeline.patch 2023-01-01 03:46:38.000000000 +0000 +++ conda-package-handling-2.1.0/debian/patches/skip-test-timeline.patch 2023-07-11 15:44:04.000000000 +0000 @@ -6,7 +6,7 @@ Last-Update: 2020-12-06 --- a/tests/test_api.py +++ b/tests/test_api.py -@@ -7,7 +7,6 @@ +@@ -7,7 +7,6 @@ import sys import tarfile import time import zipfile @@ -14,7 +14,7 @@ from tempfile import TemporaryDirectory import pytest -@@ -325,10 +324,7 @@ +@@ -327,10 +326,7 @@ def test_create_package_with_uncommon_co assert stat.st_nlink == 1 diff -Nru conda-package-handling-2.0.1/docs/api.md conda-package-handling-2.1.0/docs/api.md --- conda-package-handling-2.0.1/docs/api.md 2022-11-21 11:28:24.000000000 +0000 +++ conda-package-handling-2.1.0/docs/api.md 2023-05-04 18:42:17.000000000 +0000 @@ -6,4 +6,4 @@ :members: :undoc-members: :show-inheritance: -``` \ No newline at end of file +``` diff -Nru conda-package-handling-2.0.1/docs/cli.md conda-package-handling-2.1.0/docs/cli.md --- conda-package-handling-2.0.1/docs/cli.md 1970-01-01 00:00:00.000000000 +0000 +++ conda-package-handling-2.1.0/docs/cli.md 2023-05-04 18:42:17.000000000 +0000 @@ -0,0 +1,9 @@ +cph utility +=========== + +```{eval-rst} +.. argparse:: + :module: conda_package_handling.cli + :func: build_parser + :prog: cph +``` diff -Nru conda-package-handling-2.0.1/docs/conf.py conda-package-handling-2.1.0/docs/conf.py --- conda-package-handling-2.0.1/docs/conf.py 2022-11-21 11:28:24.000000000 +0000 +++ conda-package-handling-2.1.0/docs/conf.py 2023-05-04 18:42:17.000000000 +0000 @@ -30,6 +30,7 @@ # ones. extensions = [ "sphinx.ext.autodoc", + "sphinxarg.ext", "myst_parser", ] diff -Nru conda-package-handling-2.0.1/docs/index.md conda-package-handling-2.1.0/docs/index.md --- conda-package-handling-2.0.1/docs/index.md 2022-11-21 11:28:24.000000000 +0000 +++ conda-package-handling-2.1.0/docs/index.md 2023-05-04 18:42:17.000000000 +0000 @@ -1,20 +1,95 @@ # Welcome to conda-package-handling's documentation! -`conda-package-handling` is the library `conda` uses to handle `.conda` and -`.tar.bz2` [conda +`conda-package-handling` is a library and command line utility used to handle +`.conda` and `.tar.bz2` [conda packages](https://docs.conda.io/projects/conda/en/latest/user-guide/concepts/packages.html). -It includes a `cph` command-line utility for manipulating new- and old-format -conda packages. +`conda` and `conda-build` use `conda_package_handling.api` to create and extract +conda packages. This package also provides the `cph` command line tool to +extract, create, and convert between formats. See also [conda-package-streaming](https://github.com/conda-incubator/conda-package-streaming) -```{include} ../README.md +## A new major version + +As of version 2.x, `conda-package-handling` provides a backwards-compatible +wrapper around +[`conda-package-streaming`](https://conda.github.io/conda-package-streaming/), +plus additional package creation functionality not found in +`conda-package-streaming`. `conda-package-handling` always expects to read and +write to the filesystem. If you need a simpler API to extract or inspect conda +packages, check out +[`conda-package-streaming`](https://conda.github.io/conda-package-streaming/). + +Version 2.x is approximately two times faster extracting `.conda` packages, by +extracting `.conda`'s embedded `.tar.zst` without first writing it to a +temporary file. It uses +[`python-zstandard`](https://github.com/indygreg/python-zstandard) and the +Python standard library instead of a custom `libarchive` and so is easier to +build. Extraction does not `chdir` to the output directory, and is thread-safe. + +Version 2.x creates `.conda` packages slightly differently as well. + +* `.conda`'s `info-` archive comes after the `pkg-` archive. +* Inside `.conda`, the `info-` and `pkg-`'s ZIP metadata use a fixed timestamp, + instead of the current time - can be seen with `python -m zipfile -l + [filename].conda`. +* `.conda`'s embedded `.tar.zst` strip `uid`/`gid`/`username`/`groupname` + instead of preserving these from the filesystem. +* Both `.conda` and `.tar.bz2` are created by Python's standard `zipfile` and + `tarfile` instead of `libarchive`. + +No particular attention has been paid to archiving time which will be dominated +by the compression algorithm, but this also avoids using a temporary `.tar.zst`. + +## Overview + +There are two conda formats. The new conda format, described at [.conda file +format](https://docs.conda.io/projects/conda/en/latest/user-guide/concepts/packages.html?highlight=format#conda-file-format), +consists of an outer, uncompressed ZIP-format container, with 2 inner compressed +.tar files. It is designed to have much faster metadata access and utilize more +modern compression algorithms. The old conda format is a `.tar.bz2` archive. + +The cph command line tool can transmute (convert) the old package format to the +new one, and vice versa. + ``` +cph transmute mkl-2018.0.3-1.tar.bz2 .conda +``` + +The new package format is an indexed, uncompressed zip file that contains two +Zstandard-compressed tarfiles. The info metadata about packages is separated +into its own tarfile from the rest of the package contents. By doing this, we +can extract only the metadata, for speeding up operations like indexing. + +And, the Zstandard algorithm is much, much faster to decompress than bz2. + +Package creation is primarily something that conda-build uses, as cph only +packages but does not create metadata that makes a conda package useful. + +``` +cph create /path/to/some/dir my-cute-archive.conda +``` + +This would not necessarily create a valid conda package, unless the directory +being archived contained all the metadata in an "info" directory that a standard +conda package needs. The .conda file it creates, however, uses all the nice new +compression formats, though, and you could use cph on some other computer to +extract it. + +## Development + +Install this package and its test dependencies; run tests. + +``` +pip install -e ".[test]" +pytest +``` + +## Contents ```{toctree} -:caption: 'Contents:' :maxdepth: 2 modules ``` diff -Nru conda-package-handling-2.0.1/docs/modules.md conda-package-handling-2.1.0/docs/modules.md --- conda-package-handling-2.0.1/docs/modules.md 2022-11-21 11:28:24.000000000 +0000 +++ conda-package-handling-2.1.0/docs/modules.md 2023-05-04 18:42:17.000000000 +0000 @@ -5,5 +5,6 @@ ```{toctree} :maxdepth: 4 +cli api ``` diff -Nru conda-package-handling-2.0.1/docs/requirements.txt conda-package-handling-2.1.0/docs/requirements.txt --- conda-package-handling-2.0.1/docs/requirements.txt 1970-01-01 00:00:00.000000000 +0000 +++ conda-package-handling-2.1.0/docs/requirements.txt 2023-05-04 18:42:17.000000000 +0000 @@ -0,0 +1,8 @@ +# used in sphinx documentation build +conda-package-streaming>=0.7.0 +# docs +furo +sphinx +sphinx-argparse +myst-parser +mdit-py-plugins>=0.3.0 diff -Nru conda-package-handling-2.0.1/.github/workflows/issues.yml conda-package-handling-2.1.0/.github/workflows/issues.yml --- conda-package-handling-2.0.1/.github/workflows/issues.yml 2022-11-21 11:28:24.000000000 +0000 +++ conda-package-handling-2.1.0/.github/workflows/issues.yml 2023-05-04 18:42:17.000000000 +0000 @@ -11,19 +11,15 @@ SUPPORT_LBL: pending::support jobs: - # NOTE: doesn't catch cases where multiple users act as the author/reporter, - # this is just an effort to catch the majority of support cases + # NOTE: will update label if anyone responds, not just the author/reporter # TODO: create conda-issue-sorting team and modify this to toggle label based on # whether a non-issue-sorting engineer commented pending_support: - # if [pending::feedback] and the author responds + # if [pending::feedback] and anyone responds if: >- !github.event.repository.fork - && github.event_name == 'issue_comment' - && github.event.action == 'created' && !github.event.issue.pull_request && contains(github.event.issue.labels.*.name, 'pending::feedback') - && github.event.issue.user.login == github.event.comment.user.login runs-on: ubuntu-latest steps: # remove [pending::feedback] @@ -31,8 +27,8 @@ with: labels: ${{ env.FEEDBACK_LBL }} github_token: ${{ secrets.PROJECT_TOKEN }} - # add [pending::feedback], if still open - - uses: actions-ecosystem/action-add-labels@v1.1.0 + # add [pending::support], if still open + - uses: actions-ecosystem/action-add-labels@v1.1.3 if: github.event.issue.state == 'open' with: labels: ${{ env.SUPPORT_LBL }} diff -Nru conda-package-handling-2.0.1/.github/workflows/labels.yml conda-package-handling-2.1.0/.github/workflows/labels.yml --- conda-package-handling-2.0.1/.github/workflows/labels.yml 2022-11-21 11:28:24.000000000 +0000 +++ conda-package-handling-2.1.0/.github/workflows/labels.yml 2023-05-04 18:42:17.000000000 +0000 @@ -21,18 +21,18 @@ steps: - uses: actions/checkout@v3 - id: has_local - uses: andstor/file-existence-action@v1.0.1 + uses: andstor/file-existence-action@v2.0.0 with: files: ${{ env.LOCAL }} - name: Global Only - uses: EndBug/label-sync@v2.3.0 + uses: EndBug/label-sync@v2.3.2 if: steps.has_local.outputs.files_exists == 'false' with: config-file: ${{ env.GLOBAL }} delete-other-labels: true dry-run: ${{ github.event.inputs.dryrun }} - name: Global & Local - uses: EndBug/label-sync@v2.3.0 + uses: EndBug/label-sync@v2.3.2 if: steps.has_local.outputs.files_exists == 'true' with: config-file: | diff -Nru conda-package-handling-2.0.1/.github/workflows/lock.yml conda-package-handling-2.1.0/.github/workflows/lock.yml --- conda-package-handling-2.0.1/.github/workflows/lock.yml 2022-11-21 11:28:24.000000000 +0000 +++ conda-package-handling-2.1.0/.github/workflows/lock.yml 2023-05-04 18:42:17.000000000 +0000 @@ -4,12 +4,6 @@ # NOTE: github.event is workflow_dispatch payload: # https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#workflow_dispatch workflow_dispatch: - # inputs: - # dryrun: - # description: "dryrun: Preview locking issues/prs without marking them (true|false)" - # required: true - # type: boolean - # default: true schedule: - cron: 0 6 * * * @@ -23,35 +17,27 @@ if: '!github.event.repository.fork' runs-on: ubuntu-latest steps: - # - id: read_yaml - # uses: conda/actions/read-yaml@v22.2.1 - # with: - # path: https://raw.githubusercontent.com/conda/infra/main/.github/messages.yml - - uses: dessant/lock-threads@v2 + - uses: dessant/lock-threads@v4 with: # Number of days of inactivity before a closed issue is locked - issue-lock-inactive-days: 365 + issue-inactive-days: 365 # Do not lock issues created before a given timestamp, value must follow ISO 8601 - issue-exclude-created-before: '' + exclude-issue-created-before: '' # Do not lock issues with these labels, value must be a comma separated list of labels or '' - issue-exclude-labels: '' + exclude-any-issue-labels: '' # Labels to add before locking an issue, value must be a comma separated list of labels or '' - issue-lock-labels: 'locked' - # Comment to post before locking an issue - # issue-lock-comment: ${{ fromJSON(steps.read_yaml.outputs.value)['lock-issue'] }} + add-issue-labels: 'locked' # Reason for locking an issue, value must be one of resolved, off-topic, too heated, spam or '' issue-lock-reason: 'resolved' # Number of days of inactivity before a closed pull request is locked - pr-lock-inactive-days: 365 + pr-inactive-days: 365 # Do not lock pull requests created before a given timestamp, value must follow ISO 8601 - pr-exclude-created-before: '' + exclude-pr-created-before: '' # Do not lock pull requests with these labels, value must be a comma separated list of labels or '' - pr-exclude-labels: '' + exclude-any-pr-labels: '' # Labels to add before locking a pull request, value must be a comma separated list of labels or '' - pr-lock-labels: 'locked' - # Comment to post before locking a pull request - # pr-lock-comment: ${{ fromJSON(steps.read_yaml.outputs.value)['lock-pr'] }} + add-pr-labels: 'locked' # Reason for locking a pull request, value must be one of resolved, off-topic, too heated, spam or '' pr-lock-reason: 'resolved' diff -Nru conda-package-handling-2.0.1/.github/workflows/project.yml conda-package-handling-2.1.0/.github/workflows/project.yml --- conda-package-handling-2.0.1/.github/workflows/project.yml 2022-11-21 11:28:24.000000000 +0000 +++ conda-package-handling-2.1.0/.github/workflows/project.yml 2023-05-04 18:42:17.000000000 +0000 @@ -13,7 +13,9 @@ if: '!github.event.repository.fork' runs-on: ubuntu-latest steps: - - uses: actions/add-to-project@v0.3.0 + - uses: actions/add-to-project@v0.4.1 with: - project-url: https://github.com/orgs/conda/projects/2 + # issues are added to the Planning project + # PRs are added to the Review project + project-url: https://github.com/orgs/conda/projects/${{ github.event_name == 'issues' && 2 || 16 }} github-token: ${{ secrets.PROJECT_TOKEN }} diff -Nru conda-package-handling-2.0.1/.github/workflows/sphinx.yml conda-package-handling-2.1.0/.github/workflows/sphinx.yml --- conda-package-handling-2.0.1/.github/workflows/sphinx.yml 2022-11-21 11:28:24.000000000 +0000 +++ conda-package-handling-2.1.0/.github/workflows/sphinx.yml 2023-05-04 18:42:17.000000000 +0000 @@ -23,6 +23,7 @@ - name: Build Documentation run: | pip install -e .[docs] + pip install -r docs/requirements.txt # redundant? make html - name: Upload artifact uses: actions/upload-pages-artifact@v1 diff -Nru conda-package-handling-2.0.1/.github/workflows/stale.yml conda-package-handling-2.1.0/.github/workflows/stale.yml --- conda-package-handling-2.0.1/.github/workflows/stale.yml 2022-11-21 11:28:24.000000000 +0000 +++ conda-package-handling-2.1.0/.github/workflows/stale.yml 2023-05-04 18:42:17.000000000 +0000 @@ -14,74 +14,85 @@ schedule: - cron: 0 4 * * * +permissions: + issues: write + pull-requests: write + jobs: stale: if: '!github.event.repository.fork' runs-on: ubuntu-latest strategy: matrix: - # The issues labeled "support" have a more aggressive stale/close timeline from the rest - only-issue-labels: ['type::support', ''] + include: + - only-issue-labels: '' + days-before-issue-stale: 365 + days-before-issue-close: 30 + # [type::support] issues have a more aggressive stale/close timeline + - only-issue-labels: type::support + days-before-issue-stale: 21 + days-before-issue-close: 7 steps: - - id: read_yaml - uses: conda/actions/read-yaml@v22.9.0 + - uses: conda/actions/read-yaml@v22.9.0 + id: read_yaml with: path: https://raw.githubusercontent.com/conda/infra/main/.github/messages.yml - - uses: actions/stale@v4 + + - uses: actions/stale@v7 id: stale with: - # Idle number of days before marking issues stale (default: 60) - days-before-issue-stale: ${{ matrix.only-issue-labels && 21 || 365 }} - # Idle number of days before closing stale issues/PRs (default: 7) - days-before-issue-close: ${{ matrix.only-issue-labels && 7 || 30 }} - # Idle number of days before marking PRs stale (default: 60) + # Only issues with these labels are checked whether they are stale + only-issue-labels: ${{ matrix.only-issue-labels }} + + # Idle number of days before marking issues stale + days-before-issue-stale: ${{ matrix.days-before-issue-stale }} + # Idle number of days before closing stale issues/PRs + days-before-issue-close: ${{ matrix.days-before-issue-close }} + # Idle number of days before marking PRs stale days-before-pr-stale: 365 - # Idle number of days before closing stale PRs (default: 7) + # Idle number of days before closing stale PRs days-before-pr-close: 30 # Comment on the staled issues stale-issue-message: ${{ fromJSON(steps.read_yaml.outputs.value)['stale-issue'] }} - # Comment on the staled issues while closed - # close-issue-message: ${{ fromJSON(steps.read_yaml.outputs.value)['close-issue'] }} - # Comment on the staled PRs - stale-pr-message: ${{ fromJSON(steps.read_yaml.outputs.value)['stale-pr'] }} - # Comment on the staled PRs while closed - # close-pr-message: ${{ fromJSON(steps.read_yaml.outputs.value)['close-pr'] }} # Label to apply on staled issues - stale-issue-label: 'stale' + stale-issue-label: stale # Label to apply on closed issues - close-issue-label: 'stale::closed' + close-issue-label: stale::closed + # Reason to use when closing issues + close-issue-reason: not_planned + + # Comment on the staled PRs + stale-pr-message: ${{ fromJSON(steps.read_yaml.outputs.value)['stale-pr'] }} # Label to apply on staled PRs - stale-pr-label: 'stale' + stale-pr-label: stale # Label to apply on closed PRs - close-pr-label: 'stale::closed' + close-pr-label: stale::closed + # Reason to use when closing PRs + close-pr-reason: not_planned - # Issues with these labels will never be considered stale - exempt-issue-labels: 'stale::recovered,epic' - # Issues with these labels will never be considered stale - exempt-pr-labels: 'stale::recovered,epic' - # Only issues with these labels are checked whether they are stale - only-issue-labels: ${{ matrix.only-issue-labels }} - - # Max number of operations per run - operations-per-run: ${{ secrets.STALE_OPERATIONS_PER_RUN || 100 }} # Remove stale label from issues/PRs on updates/comments remove-stale-when-updated: true - # Add specified labels to issues/PRs when they become unstale - labels-to-add-when-unstale: 'stale::recovered' - labels-to-remove-when-unstale: 'stale,stale::closed' + labels-to-add-when-unstale: stale::recovered + # Remove specified labels to issues/PRs when they become unstale + labels-to-remove-when-unstale: stale,stale::closed - # Dry-run (default: false) + # Max number of operations per run + operations-per-run: ${{ secrets.STALE_OPERATIONS_PER_RUN || 100 }} + # Dry-run debug-only: ${{ github.event.inputs.dryrun || false }} - # Order to get issues/PRs (default: false) + # Order to get issues/PRs ascending: true - # Delete branch after closing a stale PR (default: false) + # Delete branch after closing a stale PR delete-branch: false + # Issues with these labels will never be considered stale + exempt-issue-labels: stale::recovered,epic + # Issues with these labels will never be considered stale + exempt-pr-labels: stale::recovered,epic # Exempt all issues/PRs with milestones from stale exempt-all-milestones: true - # Assignees on issues/PRs exempted from stale exempt-assignees: mingwandroid diff -Nru conda-package-handling-2.0.1/.github/workflows/tests.yml conda-package-handling-2.1.0/.github/workflows/tests.yml --- conda-package-handling-2.0.1/.github/workflows/tests.yml 2022-11-21 11:28:24.000000000 +0000 +++ conda-package-handling-2.1.0/.github/workflows/tests.yml 2023-05-04 18:42:17.000000000 +0000 @@ -18,7 +18,7 @@ python-version: [3.7, 3.8, 3.9] steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v3 - name: Additional info about the build shell: bash diff -Nru conda-package-handling-2.0.1/HOW_WE_USE_GITHUB.md conda-package-handling-2.1.0/HOW_WE_USE_GITHUB.md --- conda-package-handling-2.0.1/HOW_WE_USE_GITHUB.md 2022-11-21 11:28:24.000000000 +0000 +++ conda-package-handling-2.1.0/HOW_WE_USE_GITHUB.md 2023-05-04 18:42:17.000000000 +0000 @@ -6,7 +6,7 @@ [project-sorting]: https://github.com/orgs/conda/projects/2/views/11 [project-support]: https://github.com/orgs/conda/projects/2/views/12 [project-backlog]: https://github.com/orgs/conda/projects/2/views/13 -[project-sprint]: https://github.com/orgs/conda/projects/2/views/14 +[project-in-progress]: https://github.com/orgs/conda/projects/2/views/14 [docs-toc]: https://github.blog/changelog/2021-04-13-table-of-contents-support-in-markdown-files/ [docs-actions]: https://docs.github.com/en/actions @@ -15,6 +15,8 @@ [workflow-sync]: https://github.com/conda/infra/blob/main/.github/workflows/sync.yml [labels-global]: https://github.com/conda/infra/blob/main/.github/global.yml +[signing-commits]: https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits + [workflow-issues]: /.github/workflows/issues.yml [workflow-project]: /.github/workflows/project.yml @@ -30,6 +32,7 @@ Topics: - [What is Issue Sorting?](#what-is-issue-sorting) + - [Commit signing](#commit-signing) - [Types of tickets](#types-of-tickets) - [Normal Ticket/Issue](#normal-ticketissue) - [Epics](#epics) @@ -58,8 +61,8 @@ board_backlog-- refine -->board_backlog end - subgraph flow_sprint [Sprint] - board_sprint{{Sprint}} + subgraph flow_progress [In Progress] + board_progress{{In Progress}} end state_new(New Issues) @@ -69,9 +72,9 @@ board_sorting-- investigated -->board_backlog board_sorting-- duplicates, off-topic -->state_closed board_support-- resolved, unresponsive -->state_closed - board_backlog-- pending work -->board_sprint + board_backlog-- pending work -->board_progress board_backlog-- resolved, irrelevant -->state_closed - board_sprint-- resolved -->state_closed + board_progress-- resolved -->state_closed ``` In order to explain how various `conda` issues are evaluated, the following document will provide information about our sorting process in the form of an FAQ. @@ -129,7 +132,7 @@ All sorted issues will be reviewed by sorting engineers during a weekly Refinement meeting in order to understand how those particular issues fit into the short- and long-term roadmap of `conda`. These meetings enable the sorting engineers to get together to collectively prioritize issues, earmark feature requests for specific future releases (versus a more open-ended backlog), tag issues as ideal for first-time contributors, as well as whether or not to close/reject specific feature requests. -Once issues are deemed ready to be worked on, they will be moved to the [`conda` Backlog tab of the Planning board][project-backlog] on GitHub. Once actively in progress, the issues will be moved to the [Sprint tab of the Planning board][project-sprint] and then closed out once the work is complete. +Once issues are deemed ready to be worked on, they will be moved to the [`conda` Backlog tab of the Planning board][project-backlog] on GitHub. Once actively in progress, the issues will be moved to the [In Progress tab of the Planning board][project-in-progress] and then closed out once the work is complete. #### What is the purpose of having a "Backlog"? @@ -137,15 +140,6 @@ Issues are "backlogged" when they have been sorted but not yet earmarked for an upcoming release. Weekly Refinement meetings are a time when the `conda` engineers will transition issues from "[Sorting][project-sorting]" to "[Backlog][project-backlog]". Additionally, this time of handoff will include discussions around the kind of issues that were raised, which provides an opportunity to identify any patterns that may point to a larger problem. -#### What is the purpose of a "development sprint"? - -After issues have been sorted and backlogged, they will eventually be moved into the "Sprint Candidate", "Short-Term", "Medium-Term", "Long-Term", or "No Time Frame" sections of the [Backlog tab of the Planning board][project-backlog] and get one or more sprint cycles dedicated to them. - -The purpose of a development sprint is to enable a steady delivery of enhancements, features, and bug fixes by setting aside pre-determined portions of time that are meant for focusing on specifically-assigned items. - -Sprints also serve to focus the engineering team's attention on more accurate planning for what is to come during the entire release cycle, as well as keep the scope of development work concise. They enable the setting aside of dedicated time for the engineers to resolve any problems with the work involved, instead of pushing these problems to the end of the release cycle when there may not be any time remaining to fix issues. - - #### How does labeling work? Labeling is a very important means for sorting engineers to keep track of the current state of an issue with regards to the asynchronous nature of communicating with users. Utilizing the proper labels helps to identify the severity of the issue as well as to quickly understand the current state of a discussion. @@ -239,6 +233,13 @@ In order to not have to manually type or copy/paste the above repeatedly, please note that it's possible to add text for the most commonly-used responses via [GitHub's "Add Saved Reply" option][docs-saved-reply]. +### Commit signing + +For all conda maintainers, we require commit signing and strongly recommend it for all others wishing to contribute to conda +related projects. More information about how to set this up within GitHub can be found here: + +- [Signing Commits][signing-commits] + ### Types of Tickets #### Standard Ticket/Issue diff -Nru conda-package-handling-2.0.1/.mailmap conda-package-handling-2.1.0/.mailmap --- conda-package-handling-2.0.1/.mailmap 2022-11-21 11:28:24.000000000 +0000 +++ conda-package-handling-2.1.0/.mailmap 2023-05-04 18:42:17.000000000 +0000 @@ -49,3 +49,4 @@ Ray Donnelly Tobias "Tobi" Koch Vadim Zayakin <77290357+vz-x@users.noreply.github.com> vz-x <77290357+vz-x@users.noreply.github.com> +pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> diff -Nru conda-package-handling-2.0.1/Makefile conda-package-handling-2.1.0/Makefile --- conda-package-handling-2.0.1/Makefile 2022-11-21 11:28:24.000000000 +0000 +++ conda-package-handling-2.1.0/Makefile 2023-05-04 18:42:17.000000000 +0000 @@ -22,6 +22,3 @@ style: isort --profile=black . black . - -usage: - python update_usage.py && echo "updated README.md" || echo "unchanged README.md" \ No newline at end of file diff -Nru conda-package-handling-2.0.1/.pre-commit-config.yaml conda-package-handling-2.1.0/.pre-commit-config.yaml --- conda-package-handling-2.0.1/.pre-commit-config.yaml 1970-01-01 00:00:00.000000000 +0000 +++ conda-package-handling-2.1.0/.pre-commit-config.yaml 2023-05-04 18:42:17.000000000 +0000 @@ -0,0 +1,34 @@ +# disable autofixing PRs, commenting "pre-commit.ci autofix" on a pull request triggers a autofix +ci: + autofix_prs: false +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.4.0 + hooks: + # standard end of line/end of file cleanup + - id: mixed-line-ending + - id: end-of-file-fixer + - id: trailing-whitespace + # ensure syntaxes are valid + - id: check-toml + - id: check-yaml + exclude: ^(conda\.)?recipe/meta.yaml + # catch git merge/rebase problems + - id: check-merge-conflict + - repo: https://github.com/asottile/pyupgrade + rev: v3.3.2 + hooks: + - id: pyupgrade + args: ["--py37-plus"] + - repo: https://github.com/PyCQA/isort + rev: 5.12.0 + hooks: + - id: isort + - repo: https://github.com/psf/black + rev: 23.3.0 + hooks: + - id: black + - repo: https://github.com/PyCQA/flake8 + rev: 6.0.0 + hooks: + - id: flake8 diff -Nru conda-package-handling-2.0.1/pyproject.toml conda-package-handling-2.1.0/pyproject.toml --- conda-package-handling-2.0.1/pyproject.toml 2022-11-21 11:28:24.000000000 +0000 +++ conda-package-handling-2.1.0/pyproject.toml 2023-05-04 18:42:17.000000000 +0000 @@ -1,3 +1,7 @@ [tool.black] # consider reverting to standard line length -line-length = 99 \ No newline at end of file +line-length = 99 + +[tool.isort] +profile = "black" +line_length = 99 diff -Nru conda-package-handling-2.0.1/README.md conda-package-handling-2.1.0/README.md --- conda-package-handling-2.0.1/README.md 2022-11-21 11:28:24.000000000 +0000 +++ conda-package-handling-2.1.0/README.md 2023-05-04 18:42:17.000000000 +0000 @@ -1,101 +1,11 @@ # conda-package-handling -Create and extract conda packages of various formats - -``` -usage: cph [-h] [-V] {extract,x,create,c,transmute,t} ... - -options: - -h, --help show this help message and exit - -V, --version Show the conda-package-handling version number and - exit. - -subcommands: - {extract,x,create,c,transmute,t} - extract (x) extract package contents - create (c) bundle files into a package - transmute (t) convert from one package type to another - -``` - -Full documentation at https://conda.github.io/conda-package-handling/ - -cph is an abstraction of conda package handling and a tool for extracting, -creating, and converting between formats. - -There are two conda formats. The new conda format, described at [.conda file -format](https://docs.conda.io/projects/conda/en/latest/user-guide/concepts/packages.html?highlight=format#conda-file-format), -consists of an outer, uncompressed ZIP-format container, with 2 inner compressed -.tar files. It is designed to have much faster metadata access and utilize more -modern compression algorithms. The old conda format is a `.tar.bz2` archive. - -One can transmute (convert) the old package format to the new one with cph: - -``` -cph transmute mkl-2018.0.3-1.tar.bz2 .conda -``` - -One can then test the speed of extracting the old file and the new one: - -``` -$ time cph extract mkl-2018.0.3-1.tar.bz2 --dest mkl-a -cph extract mkl-2018.0.3-1.tar.bz2 --dest mkl-a 18.16s user 0.59s system 98% cpu 19.015 total -$ time cph extract mkl-2018.0.3-1.conda --dest mkl-b -cph extract mkl-2018.0.3-1.conda --dest mkl-b 1.41s user 0.65s system 87% cpu 2.365 total -``` -The new package format is an indexed, uncompressed zip file that contains two -Zstandard compressed tarfiles. The info metadata about packages is separated -into its own tarfile from the rest of the package contents. By doing this, we -can extract only the metadata, for speeding up operations like indexing. +[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/conda/conda-package-handling/main.svg)](https://results.pre-commit.ci/latest/github/conda/conda-package-handling/main) -``` -$ time cph extract mkl-2018.0.3-1.conda --dest mkl-b --info -cph extract mkl-2018.0.3-1.conda --dest mkl-b --info 0.21s user 0.07s system 98% cpu 0.284 total``` -``` - -Package creation is primarily something that conda-build uses, as cph does -absolutely nothing to create metadata that makes a conda package useful. -However, you may consider it useful to abuse cph's package creation as a way of -utilizing newer compression formats. - -``` -cph create /path/to/some/dir my-cute-archive.conda -``` - -Again, this would not necessarily create a valid conda package, unless the -directory being archived contained all the metadata in an "info" directory that -a standard conda package needs. The .conda file it creates, however, uses all -the nice new compression formats, though, and you could use cph on some other -computer to extract it. - -## Development - -Install this package and its test dependencies; run tests. - -``` -pip install -e ".[test]" -pytest -``` - -## Releasing - -Conda-package-handling releases may be performed via the `rever command -`_. Rever is configured to perform the -activities for a typical conda-build release. To cut a release, simply run -``rever `` where ```` is the release number that you want bump to. -For example, ``rever 1.2.3``. However, it is always good idea to make sure that -the you have permissions everywhere to actually perform the release. So it is -customary to run ``rever check`` before the release, just to make sure. The -standard workflow is thus:: - - rever check - rever 1.2.3 - -If for some reason a release fails partway through, or you want to claw back a -release that you have made, rever allows you to undo activities. If you find -yourself in this pickle, you can pass the ``--undo`` option a comma-separated -list of activities you'd like to undo. For example:: +Create and extract conda packages of various formats - rever --undo tag,changelog,authors 1.2.3 +`conda` and `conda-build` use `conda_package_handling.api` to create and extract +conda packages. This package also provides the `cph` command line tool to +extract, create, and convert between formats. - Happy releasing! +Full documentation at [https://conda.github.io/conda-package-handling/](https://conda.github.io/conda-package-handling/) diff -Nru conda-package-handling-2.0.1/requirements.txt conda-package-handling-2.1.0/requirements.txt --- conda-package-handling-2.0.1/requirements.txt 2022-11-21 11:28:24.000000000 +0000 +++ conda-package-handling-2.1.0/requirements.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,7 +0,0 @@ -# used in sphinx documentation build -conda-package-streaming>=0.7.0 -# docs -furo -sphinx -myst-parser -mdit-py-plugins>=0.3.0 diff -Nru conda-package-handling-2.0.1/setup.py conda-package-handling-2.1.0/setup.py --- conda-package-handling-2.0.1/setup.py 2022-11-21 11:28:24.000000000 +0000 +++ conda-package-handling-2.1.0/setup.py 2023-05-04 18:42:17.000000000 +0000 @@ -25,7 +25,7 @@ python_requires=">=3.7", install_requires=["conda-package-streaming >= 0.7.0"], extras_require={ - "docs": ["furo", "sphinx", "myst-parser", "mdit-py-plugins>=0.3.0"], + "docs": ["furo", "sphinx", "sphinx-argparse", "myst-parser", "mdit-py-plugins>=0.3.0"], "test": ["mock", "pytest", "pytest-cov", "pytest-mock"], }, ) diff -Nru conda-package-handling-2.0.1/src/conda_package_handling/cli.py conda-package-handling-2.1.0/src/conda_package_handling/cli.py --- conda-package-handling-2.0.1/src/conda_package_handling/cli.py 2022-11-21 11:28:24.000000000 +0000 +++ conda-package-handling-2.1.0/src/conda_package_handling/cli.py 2023-05-04 18:42:17.000000000 +0000 @@ -7,6 +7,11 @@ def parse_args(parse_this=None): + parser = build_parser() + return parser.parse_args(parse_this) + + +def build_parser(): parser = argparse.ArgumentParser() parser.add_argument( "-V", @@ -84,11 +89,11 @@ "--zstd-compression-level", help=( "When building v2 packages, set the compression level used by " - "conda-package-handling. Defaults to the maximum." + "conda-package-handling. Defaults to 19." ), type=int, choices=range(1, 23), - default=22, + default=19, ) convert_parser.add_argument( "--zstd-compression-threads", @@ -99,7 +104,8 @@ type=int, default=1, ) - return parser.parse_args(parse_this) + + return parser def main(args=None): diff -Nru conda-package-handling-2.0.1/src/conda_package_handling/conda_fmt.py conda-package-handling-2.1.0/src/conda_package_handling/conda_fmt.py --- conda-package-handling-2.0.1/src/conda_package_handling/conda_fmt.py 2022-11-21 11:28:24.000000000 +0000 +++ conda-package-handling-2.1.0/src/conda_package_handling/conda_fmt.py 2023-05-04 18:42:17.000000000 +0000 @@ -19,10 +19,10 @@ from .streaming import _extract CONDA_PACKAGE_FORMAT_VERSION = 2 -DEFAULT_COMPRESSION_TUPLE = (".tar.zst", "zstd", "zstd:compression-level=22") +DEFAULT_COMPRESSION_TUPLE = (".tar.zst", "zstd", "zstd:compression-level=19") # increase to reduce speed and increase compression (22 = conda's default) -ZSTD_COMPRESS_LEVEL = 22 +ZSTD_COMPRESS_LEVEL = 19 # increase to reduce compression (slightly) and increase speed ZSTD_COMPRESS_THREADS = 1 @@ -85,10 +85,24 @@ threads=ZSTD_COMPRESS_THREADS, ) + class NullWriter: + """ + zstd uses less memory on extract if size is known. + """ + + def __init__(self): + self.size = 0 + + def write(self, bytes): + self.size += len(bytes) + return len(bytes) + + def tell(self): + return self.size + with ZipFile(conda_pkg_fn, "w", compression=ZIP_STORED) as conda_file, utils.tmp_chdir( prefix ): - pkg_metadata = {"conda_pkg_format_version": CONDA_PACKAGE_FORMAT_VERSION} conda_file.writestr("metadata.json", json.dumps(pkg_metadata)) @@ -98,10 +112,20 @@ ) # put the info last, for parity with updated transmute. + compress = compressor() for component, files in components_files: - compress = compressor() + # If size is known, the decompressor may be able to allocate less memory. + # The compressor will error if size is not correct. + with tarfile.TarFile(fileobj=NullWriter(), mode="w") as sizer: # type: ignore + for file in files: + sizer.add(file, filter=utils.anonymize_tarinfo) + size = sizer.fileobj.size # type: ignore + with conda_file.open(component, "w") as component_file: - component_stream = compress.stream_writer(component_file, closefd=False) + # only one stream_writer() per compressor() must be in use at a time + component_stream = compress.stream_writer( + component_file, size=size, closefd=False + ) component_tar = tarfile.TarFile(fileobj=component_stream, mode="w") for file in files: diff -Nru conda-package-handling-2.0.1/src/conda_package_handling/exceptions.py conda-package-handling-2.1.0/src/conda_package_handling/exceptions.py --- conda-package-handling-2.0.1/src/conda_package_handling/exceptions.py 2022-11-21 11:28:24.000000000 +0000 +++ conda-package-handling-2.1.0/src/conda_package_handling/exceptions.py 2023-05-04 18:42:17.000000000 +0000 @@ -46,7 +46,8 @@ errors = "Missing files in converted package: %s\n" % self.missing_files errors = ( errors - + "Mismatching sizes (corruption) in converted package: %s" % self.mismatching_sizes + + "Mismatching sizes (corruption) in converted package: %s" # noqa + % self.mismatching_sizes ) super().__init__(errors, *args, **kw) diff -Nru conda-package-handling-2.0.1/src/conda_package_handling/__init__.py conda-package-handling-2.1.0/src/conda_package_handling/__init__.py --- conda-package-handling-2.0.1/src/conda_package_handling/__init__.py 2022-11-21 11:28:24.000000000 +0000 +++ conda-package-handling-2.1.0/src/conda_package_handling/__init__.py 2023-05-04 18:42:17.000000000 +0000 @@ -1 +1 @@ -__version__ = "2.0.1" +__version__ = "2.1.0" diff -Nru conda-package-handling-2.0.1/src/conda_package_handling/tarball.py conda-package-handling-2.1.0/src/conda_package_handling/tarball.py --- conda-package-handling-2.0.1/src/conda_package_handling/tarball.py 2022-11-21 11:28:24.000000000 +0000 +++ conda-package-handling-2.1.0/src/conda_package_handling/tarball.py 2023-05-04 18:42:17.000000000 +0000 @@ -2,11 +2,8 @@ import os import re import tarfile -from errno import ELOOP -from tempfile import NamedTemporaryFile from . import streaming, utils -from .exceptions import CaseInsensitiveFileSystemError, InvalidArchiveError from .interface import AbstractBaseFormat LOG = logging.getLogger(__file__) diff -Nru conda-package-handling-2.0.1/src/conda_package_handling/utils.py conda-package-handling-2.1.0/src/conda_package_handling/utils.py --- conda-package-handling-2.0.1/src/conda_package_handling/utils.py 2022-11-21 11:28:24.000000000 +0000 +++ conda-package-handling-2.1.0/src/conda_package_handling/utils.py 2023-05-04 18:42:17.000000000 +0000 @@ -162,9 +162,7 @@ except CalledProcessError as e: if e.returncode != 5: - log.error( - "Removing folder {} the fast way failed. Output was: {}".format(out) - ) + log.error(f"Removing folder {path} the fast way failed. Output was: {out}") raise else: log.debug(f"removing dir contents the fast way failed. Output was: {out}") @@ -421,27 +419,27 @@ files_list, prefix, filter_patterns=( - "info[\\\\/]index.json", + "info[\\\\/]index\\.json", "info[\\\\/]files", - "info[\\\\/]paths.json", - "info[\\\\/]about.json", + "info[\\\\/]paths\\.json", + "info[\\\\/]about\\.json", "info[\\\\/]has_prefix", "info[\\\\/]hash_input_files", # legacy, not used anymore - "info[\\\\/]hash_input.json", - "info[\\\\/]run_exports.yaml", # legacy - "info[\\\\/]run_exports.json", # current + "info[\\\\/]hash_input\\.json", + "info[\\\\/]run_exports\\.yaml", # legacy + "info[\\\\/]run_exports\\.json", # current "info[\\\\/]git", "info[\\\\/]recipe[\\\\/].*", "info[\\\\/]recipe_log.json", "info[\\\\/]recipe.tar", "info[\\\\/]test[\\\\/].*", - "info[\\\\/]LICENSE.txt", + "info[\\\\/]LICENSE.*", "info[\\\\/]requires", "info[\\\\/]meta", "info[\\\\/]platform", "info[\\\\/]no_link", - "info[\\\\/]link.json", - "info[\\\\/]icon.png", + "info[\\\\/]link\\.json", + "info[\\\\/]icon\\.png", ), ) diff -Nru conda-package-handling-2.0.1/src/conda_package_handling/validate.py conda-package-handling-2.1.0/src/conda_package_handling/validate.py --- conda-package-handling-2.0.1/src/conda_package_handling/validate.py 2022-11-21 11:28:24.000000000 +0000 +++ conda-package-handling-2.1.0/src/conda_package_handling/validate.py 2023-05-04 18:42:17.000000000 +0000 @@ -81,7 +81,6 @@ for tar, member in package_streaming.stream_conda_component( filename, conda_file, component ): - info = {k: v for k, v in member.get_info().items() if k not in ignore_fields} if member.isfile(): diff -Nru conda-package-handling-2.0.1/tests/memory_test.py conda-package-handling-2.1.0/tests/memory_test.py --- conda-package-handling-2.0.1/tests/memory_test.py 1970-01-01 00:00:00.000000000 +0000 +++ conda-package-handling-2.1.0/tests/memory_test.py 2023-05-04 18:42:17.000000000 +0000 @@ -0,0 +1,18 @@ +""" +Simple test for evaluating zstandard binding memory usage. +""" +import io +import sys + +import zstandard + +if __name__ == "__main__": + times = 100 + if len(sys.argv) == 3: + times = int(sys.argv[2]) + + for i in range(times): + compressor = zstandard.ZstdCompressor(level=int(sys.argv[1])) + writer = compressor.stream_writer(io.BytesIO()) + writer.write(b"hello") + writer.close() diff -Nru conda-package-handling-2.0.1/tests/test_api.py conda-package-handling-2.1.0/tests/test_api.py --- conda-package-handling-2.0.1/tests/test_api.py 2022-11-21 11:28:24.000000000 +0000 +++ conda-package-handling-2.1.0/tests/test_api.py 2023-05-04 18:42:17.000000000 +0000 @@ -164,8 +164,9 @@ for member in repacked: if member.name.startswith("info"): assert ( - not_info_seen == False - ), f"{test_package} package info/ must sort first, but {[m.name for m in repacked.getmembers()]}" + not_info_seen is False + ), f"{test_package} package info/ must sort first, " + f"but {[m.name for m in repacked.getmembers()]}" info_seen = True else: not_info_seen = True @@ -280,9 +281,10 @@ "symlink_stuff/symlink_to_text_file", ) - cph_created = api.create("src", None, "thebrain.tar.bz2") + api.create("src", None, "thebrain.tar.bz2") - # test against both archives created manually and those created by cph. They should be equal in all ways. + # test against both archives created manually and those created by cph. + # They should be equal in all ways. for fn in ("pinkie.tar.bz2", "thebrain.tar.bz2"): api.extract(fn) target_dir = fn[:-8] @@ -306,7 +308,7 @@ path_that_should_be_there = os.path.join(testing_workdir, target_dir, f) if not ( os.path.exists(path_that_should_be_there) - or os.path.lexists(path_that_should_be_there) + or os.path.lexists(path_that_should_be_there) # noqa ): missing_content.append(f) if missing_content: diff -Nru conda-package-handling-2.0.1/tests/test_cli.py conda-package-handling-2.1.0/tests/test_cli.py --- conda-package-handling-2.0.1/tests/test_cli.py 2022-11-21 11:28:24.000000000 +0000 +++ conda-package-handling-2.1.0/tests/test_cli.py 2023-05-04 18:42:17.000000000 +0000 @@ -45,4 +45,4 @@ e.g. python -m conda_package_handling """ with pytest.raises(SystemExit): - import conda_package_handling.__main__ + import conda_package_handling.__main__ # noqa diff -Nru conda-package-handling-2.0.1/tests/test_degraded.py conda-package-handling-2.1.0/tests/test_degraded.py --- conda-package-handling-2.0.1/tests/test_degraded.py 2022-11-21 11:28:24.000000000 +0000 +++ conda-package-handling-2.1.0/tests/test_degraded.py 2023-05-04 18:42:17.000000000 +0000 @@ -21,7 +21,7 @@ importlib.reload(conda_package_handling.api) - assert conda_package_handling.api.libarchive_enabled == False + assert conda_package_handling.api.libarchive_enabled is False finally: sys.modules.pop("zstandard", None) @@ -31,7 +31,7 @@ importlib.reload(conda_package_handling.api) - assert conda_package_handling.api.libarchive_enabled == True + assert conda_package_handling.api.libarchive_enabled is True def test_degraded_subprocess(): diff -Nru conda-package-handling-2.0.1/tests/test_interface.py conda-package-handling-2.1.0/tests/test_interface.py --- conda-package-handling-2.0.1/tests/test_interface.py 2022-11-21 11:28:24.000000000 +0000 +++ conda-package-handling-2.1.0/tests/test_interface.py 2023-05-04 18:42:17.000000000 +0000 @@ -23,7 +23,6 @@ (CondaFormat_v2, TEST_CONDA, "newmock.conda"), (CondaTarBZ2, TEST_TARBZ, "newmock.tar.bz2"), ): - both_path = Path(tmpdir, f"mkdirs-{outfile.split('.', 1)[-1]}") # these old APIs don't guarantee Path-like's diff -Nru conda-package-handling-2.0.1/tests/test_utils.py conda-package-handling-2.1.0/tests/test_utils.py --- conda-package-handling-2.0.1/tests/test_utils.py 2022-11-21 11:28:24.000000000 +0000 +++ conda-package-handling-2.1.0/tests/test_utils.py 2023-05-04 18:42:17.000000000 +0000 @@ -28,10 +28,9 @@ # force a second error for the inner rename try (after unlink fails) if sys.platform == "win32": - with open("dummy", "w") as f: f.write("weeee") - rename = mocker.patch("os.rename") + mocker.patch("os.rename") unlink.side_effect = EnvironmentError(errno, "") utils.unlink_or_rename_to_trash("dummy") assert os.path.isfile("dummy.conda_trash") @@ -42,7 +41,7 @@ isdir.return_value = True lexists = mocker.patch("conda_package_handling.utils.lexists") lexists.return_value = False - rmdir = mocker.patch("conda_package_handling.utils.rmdir") + mocker.patch("conda_package_handling.utils.rmdir") os.makedirs("folder") with open("folder/dummy.conda_trash", "w") as f: diff -Nru conda-package-handling-2.0.1/update_usage.py conda-package-handling-2.1.0/update_usage.py --- conda-package-handling-2.0.1/update_usage.py 2022-11-21 11:28:24.000000000 +0000 +++ conda-package-handling-2.1.0/update_usage.py 1970-01-01 00:00:00.000000000 +0000 @@ -1,37 +0,0 @@ -#!/usr/bin/env python -""" -Replace usage section of README.md with current help text. -""" - -import pathlib -import subprocess -import sys - -process = subprocess.run(["cph", "-h"], capture_output=True, encoding="utf-8") -usage = process.stdout - -readme = pathlib.Path("README.md") -text = readme.read_text() - -output = [] - -lines = iter(text.splitlines()) -for line in lines: - output.append(line) - if line.startswith("```"): - break - -output.append(usage) -output.append("```") -for line in lines: - if line.startswith("```"): - break - -output.extend(lines) - -new_text = "\n".join(output) + "\n" -if new_text != text: - readme.write_text(new_text) - sys.exit(0) - -sys.exit(1)