-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Working initial implementation With tests Remove unneeded steps Comment? Uncomment Add more black configuration Fix test command Fix mkdir test Update release workflows Update tag convention Fix coverage and ruff source Add developer notes Fix coverage configuration Use a counter for data for shorter file paths Fix lint Remove extraneous colon Install zip for Windows Add more tests Use sys.executable for full path to python Badges Rename to repzip as a working name Add codecov.yml configuration * Rename to rpzip * Finish renaming to rpzip * Swap to ruff formatter; fix lint * Pin below pytest 8 for pytest-cases compatibility * More README polish * Update changelog --------- Co-authored-by: Jay Qi <jayqi@users.noreply.github.com>
- Loading branch information
Showing
13 changed files
with
489 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
name: release | ||
|
||
on: | ||
push: | ||
tags: | ||
- "cli-v*" | ||
|
||
jobs: | ||
build: | ||
name: Publish CLI release | ||
runs-on: "ubuntu-latest" | ||
defaults: | ||
run: | ||
working-directory: ./cli | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.10" | ||
|
||
- name: Install hatch | ||
run: | | ||
pip install hatch | ||
- name: Check that versions match | ||
id: version | ||
run: | | ||
echo "Release tag: [${{ github.event.release.tag_name }}]" | ||
PACKAGE_VERSION=$(hatch run rpzip --version) | ||
echo "Package version: [$PACKAGE_VERSION]" | ||
[ ${{ github.event.release.tag_name }} == "v$PACKAGE_VERSION" ] || { exit 1; } | ||
echo "::set-output name=major_minor_version::v${PACKAGE_VERSION%.*}" | ||
- name: Build package | ||
run: | | ||
hatch build | ||
- name: Publish to Test PyPI | ||
uses: pypa/gh-action-pypi-publish@v1.3.0 | ||
with: | ||
user: ${{ secrets.PYPI_TEST_USERNAME }} | ||
password: ${{ secrets.PYPI_TEST_PASSWORD }} | ||
repository_url: https://test.pypi.org/legacy/ | ||
skip_existing: true | ||
|
||
- name: Publish to Production PyPI | ||
uses: pypa/gh-action-pypi-publish@v1.3.0 | ||
with: | ||
user: ${{ secrets.PYPI_PROD_USERNAME }} | ||
password: ${{ secrets.PYPI_PROD_PASSWORD }} | ||
skip_existing: false |
10 changes: 5 additions & 5 deletions
10
.github/workflows/release.yml → .github/workflows/release-lib.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Changelog — rpzip | ||
|
||
## v0.1.0 (2024-01-27) | ||
|
||
Initial release! 🎉 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
MIT License | ||
|
||
Copyright (c) 2023 DrivenData Inc. | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy of | ||
this software and associated documentation files (the “Software”), to deal in | ||
the Software without restriction, including without limitation the rights to | ||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of | ||
the Software, and to permit persons to whom the Software is furnished to do so, | ||
subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS | ||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR | ||
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER | ||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | ||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# rpzip — a CLI backed by repro-zipfile | ||
|
||
[![PyPI](https://img.shields.io/pypi/v/rpzip.svg)](https://pypi.org/project/rpzip/) | ||
[![Supported Python versions](https://img.shields.io/pypi/pyversions/rpzip)](https://pypi.org/project/rpzip/) | ||
[![tests](https://github.com/drivendataorg/repro-zipfile/actions/workflows/tests.yml/badge.svg?branch=main)](https://github.com/drivendataorg/repro-zipfile/actions/workflows/tests.yml?query=branch%3Amain) | ||
[![codecov](https://codecov.io/gh/drivendataorg/repro-zipfile/branch/main/graph/badge.svg)](https://codecov.io/gh/drivendataorg/repro-zipfile) | ||
|
||
**A lightweight command-line program for creating reproducible/deterministic ZIP archives.** | ||
|
||
"Reproducible" or "deterministic" in this context means that the binary content of the ZIP archive is identical if you add files with identical binary content in the same order. It means you can reliably check equality of the contents of two ZIP archives by simply comparing checksums of the archive using a hash function like MD5 or SHA-256. | ||
|
||
This package provides a command-line program named **rpzip**. It is designed as a partial drop-in replacement for the ubiquitous [zip](https://linux.die.net/man/1/zip) program and implements a commonly used subset of zip's inferface. | ||
|
||
For further documentation, see the ["rpzip command line program"](https://github.com/drivendataorg/repro-zipfile#rpzip-command-line-program) section of the repro-zipfile README. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
[build-system] | ||
requires = ["hatchling"] | ||
build-backend = "hatchling.build" | ||
|
||
[project] | ||
name = "rpzip" | ||
dynamic = ["version"] | ||
description = "A lightweight command-line program for creating reproducible/deterministic ZIP archives." | ||
readme = "README.md" | ||
requires-python = ">=3.8" | ||
license = "MIT" | ||
keywords = ["zipfile", "zip", "reproducible", "deterministic", "cli"] | ||
authors = [{ name = "DrivenData", email = "info@drivendata.org" }] | ||
classifiers = [ | ||
"Intended Audience :: Developers", | ||
"Intended Audience :: Science/Research", | ||
"License :: OSI Approved :: MIT License", | ||
"Operating System :: OS Independent", | ||
"Programming Language :: Python", | ||
"Programming Language :: Python :: 3.8", | ||
"Programming Language :: Python :: 3.9", | ||
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Python :: 3.11", | ||
"Programming Language :: Python :: 3.12", | ||
"Topic :: System :: Archiving", | ||
"Topic :: System :: Archiving :: Compression", | ||
"Topic :: System :: Archiving :: Packaging", | ||
] | ||
dependencies = ["repro-zipfile", "typer>=0.9.0", "typing_extensions>=3.9 ; python_version < '3.9'"] | ||
|
||
[project.scripts] | ||
rpzip = "rpzip:app" | ||
|
||
[project.urls] | ||
Documentation = "https://github.com/drivendataorg/repro-zipfile#readme" | ||
Issues = "https://github.com/drivendataorg/repro-zipfile/issues" | ||
Source = "https://github.com/drivendataorg/repro-zipfile/tree/main/cli" | ||
|
||
[tool.hatch.version] | ||
path = "rpzip.py" | ||
|
||
## TOOLS ## | ||
|
||
[tool.black] | ||
line-length = 99 |
Oops, something went wrong.