Exclude more files from the published crate (#591)

There was an incorrect glob `bench/*` that was doing nothing, since the
benchmarks are in `benches/`; when I corrected it to `benches/*`, `cargo
publish --dry-run` failed:

```
error: failed to verify package tarball

Caused by:
  failed to parse manifest at `/home/ben/src/forks/oxipng/target/package/oxipng-9.0.0/Cargo.toml`

Caused by:
  can't find `zopfli` bench at `benches/zopfli.rs` or `benches/zopfli/main.rs`. Please specify bench.path if you want to use a non-default path.
```

…so I stopped trying to exclude the benchmarks from published crates at
all.

-----

Then, I added `Dockerfile`, `index.html`, and `scripts/` to the list of
paths to exclude from published crates.

Finally, I added some unnecessary “dotfiles” to the list of paths to
exclude from published crates.

-----

Some of this was suggested in a [package review for Fedora
Linux](https://bugzilla.redhat.com/show_bug.cgi?id=2259760).

After the PR:

```
$ cargo package --list
.cargo/config.toml
.cargo_vcs_info.json
CHANGELOG.md
Cargo.lock
Cargo.toml
Cargo.toml.orig
LICENSE
MANUAL.txt
README.md
benches/deflate.rs
[…]
benches/zopfli.rs
src/atomicmin.rs
[…]
src/sanity_checks.rs
$ cargo publish --dry-run
[…]
   Compiling oxipng v9.0.0 (/home/ben/src/forks/oxipng/target/package/oxipng-9.0.0)
    Finished dev [optimized + debuginfo] target(s) in 15.76s
    Packaged 37 files, 255.4KiB (61.6KiB compressed)
   Uploading oxipng v9.0.0 (/home/ben/src/forks/oxipng)
warning: aborting upload due to dry run
```
This commit is contained in:
Ben Beasley 2024-02-17 15:20:17 -05:00 committed by GitHub
parent 1b500da585
commit 4cb8296b02
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 10 additions and 2 deletions

View file

@ -4,7 +4,16 @@ categories = ["command-line-utilities", "compression"]
description = "A lossless PNG compression optimizer"
documentation = "https://docs.rs/oxipng"
edition = "2021"
exclude = ["tests/*", "bench/*"]
exclude = [
".editorconfig",
".gitattributes",
".github/*",
".gitignore",
".pre-commit-hooks.yaml",
"Dockerfile",
"scripts/*",
"tests/*",
]
homepage = "https://github.com/shssoichiro/oxipng"
license = "MIT"
name = "oxipng"

View file

@ -1 +0,0 @@
<script>(function() {window.location.assign(window.location.href + "doc/oxipng/");})();</script>