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

Release 4.0.0 #1020

Merged
merged 13 commits into from
Jul 3, 2024
104 changes: 56 additions & 48 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,61 +39,38 @@ CLI command and its behaviour. There are no guarantees of stability for the
### Security
-->

## Unreleased - YYYY-MM-DD

### Added
## 4.0.0 - 2024-07-03

- More file types are recognised:
- CSON (`.cson`) (#1002)
- Hjson (`.hjson`) (#1002)
- JSON5 (`.json5`) (#1002)
- JSON with Comments (`.jsonc`) (#1002)
- Tap (`.taprc`) (#997)
- Zsh (`.zshrc`) (#997)
- Perl test (`.t`) (#997)
- BATS test (`.bats`) (#997)
- Octave/Matlab (`.m`) (#604)
- VHDL(`.vhdl`) (#564)
- Support alternate spelling `--skip-unrecognized`. (#974)
- In `annotate`, rename `--copyright-style` to `--copyright-prefix`. The former
parameter is still supported. (#973)
- Support alternate spelling `--skip-unrecognized` (#974)
- `cpp` and `cppsingle` style shorthands (see changes). (#941)

### Changed

- Reorganised the way that `c`, `css`, and `csingle` styles work. (#941)
- `c` used to support multi-line comments; it now only supports multi-line
`/* */` comments. This is identical to the old `css` style.
- `cpp` has been added, which supports multi-line `/* */` comments and
single-line `//` comments. This is identical to the old `c` style.
- `csingle` has been renamed to `cppsingle`, and it supports only single-line
`//` comments.

### Deprecated

- `csingle` and `css` style shorthands (see changes). (#941)

### Removed

- The PendingDeprecationWarning for the aggregation of information between DEP5
and the contents of a file has been removed. This behaviour is now explicitly
specified in REUSE Specification v3.2. (#1017, related to #779)
This release of REUSE implements the new
[REUSE Specification v3.2](https://reuse.software/spec-3.2). It adds the
`REUSE.toml` file format as a replacement for `.reuse/dep5`. The new format is
easier to write and parse, is better at disambiguating certain corner cases, and
is more flexible for customisation and future additions.

### Fixed
To convert your existing `.reuse/dep5` to `REUSE.toml`, you can simply use the
`reuse convert-dep5` command.

- In `reuse spdx`, fixed the output to be more compliant by capitalising
`SPDXRef-Document DESCRIBES` appropriately. (#1013)
Alongside the `REUSE.toml` feature is a wealth of other improvements.
`reuse lint --lines` may be especially interesting for CI workflows, as well as
the fact that the amount of `PendingDeprecationWarning`s has been drastically
reduced now that the information aggregation behaviour of `.reuse/dep5` is
explicitly defined in the specification.

### Security
The tool has also been made easier to use with the addition of man pages. The
man pages can be found online at <https://reuse.readthedocs.io/en/stable/man/>.
Your distribution's packager will need to make them accessible via
`man reuse(1)`. Unfortunately, man pages cannot be made accessible via Python's
packaging, although the full documentation (including man pages) is included in
the sdist.

## 3.1.0a1 - 2024-05-28
This changeset also contains the changes of v3.1.0a1.

### Added

- Added support for `REUSE.toml`. (#863)
- Manpages added for all `reuse` commands. Distribution maintainers might wish
to distribute the (Sphinx-built) manpages. (#975)
- Added `reuse convert-dep5` to convert `.reuse/dep5` to `REUSE.toml`. (#863)
- Man pages added for all `reuse` commands. Distribution maintainers might wish
to distribute the (Sphinx-built) man pages. (#975)
- More file types are recognised:
- Assembler (`.asm`) (#928)
- GraphQL (`.graphqls`, `.gqls`) (#930)
Expand All @@ -106,11 +83,27 @@ CLI command and its behaviour. There are no guarantees of stability for the
- Apache HTTP server config `.htaccess` files (#985)
- npm `.npmrc` files (#985)
- LaTeX class files (`.cls`) (#971)
- CSON (`.cson`) (#1002)
- Hjson (`.hjson`) (#1002)
- JSON5 (`.json5`) (#1002)
- JSON with Comments (`.jsonc`) (#1002)
- Tap (`.taprc`) (#997)
- Zsh (`.zshrc`) (#997)
- Perl test (`.t`) (#997)
- BATS test (`.bats`) (#997)
- Octave/Matlab (`.m`) (#604)
- VHDL(`.vhdl`) (#564)
- Earthly files (`Earthfile` and `.earthlyignore`) (#1024)
- Added comment styles:
- `man` for UNIX Man pages (`.man`) (#954)
- Added `--lines` output option for `lint`. (#956)
- Treat `% !TEX` and `% !BIB` as shebangs in TeX and BibTeX files, respectively
(#971)
- Support alternate spelling `--skip-unrecognized`. (#974)
- In `annotate`, rename `--copyright-style` to `--copyright-prefix`. The former
parameter is still supported. (#973)
- Support alternate spelling `--skip-unrecognized` (#974)
- `cpp` and `cppsingle` style shorthands (see changes). (#941)

### Changed

Expand All @@ -124,22 +117,37 @@ CLI command and its behaviour. There are no guarantees of stability for the
- Dependencies added:
- `attrs>=21.1` (#863)
- `tomlkit>=0.8` (#863)
- Reorganised the way that `c`, `css`, and `csingle` styles work. (#941)
- `c` used to support multi-line comments; it now only supports multi-line
`/* */` comments. This is identical to the old `css` style.
- `cpp` has been added, which supports multi-line `/* */` comments and
single-line `//` comments. This is identical to the old `c` style.
- `csingle` has been renamed to `cppsingle`, and it supports only single-line
`//` comments.

### Deprecated

- `.reuse/dep5` is marked deprecated. `reuse convert-dep5` will help you switch
to `REUSE.toml`. (#863)

### Removed

- The PendingDeprecationWarning for the aggregation of information between DEP5
and the contents of a file has been removed. This behaviour is now explicitly
specified in REUSE Specification v3.2. (#1017, related to #779)
- `reuse init` removed. (#863)
- `csingle` and `css` style shorthands (see changes). (#941)

### Fixed

- Clearer instructions for `--suppress-deprecation` in deprecation warning.
(#949)
- The datetime value for `Created:` was wrongly formatted since 3.0.0. It now
returns a correctly formatted ISO 8601 date again. (#952)
- Repaired the behaviour of `reuse download` where being inside of a LICENSES/
directory should not create a deeper LICENSES/LICENSES/ directory. (#975)
- Support annotating a file that contains only a shebang. (#965)
- Add `CONTRIBUTING.md` to the sdist. (#987)
- In `reuse spdx`, fixed the output to be more compliant by capitalising
`SPDXRef-Document DESCRIBES` appropriately. (#1013)

## 3.0.2 - 2024-04-08

Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

[tool.poetry]
name = "reuse"
version = "3.1.0a1"
version = "4.0.0"
description = "reuse is a tool for compliance with the REUSE recommendations."
authors = [
"Free Software Foundation Europe <[email protected]>",
Expand Down Expand Up @@ -102,7 +102,7 @@ requires = ["poetry-core>=1.1.0"]
build-backend = "poetry.core.masonry.api"

[bumpver]
current_version = "v3.1.0a1"
current_version = "v4.0.0"
version_pattern = "vMAJOR.MINOR.PATCH[PYTAGNUM]"
commit_message = "Bump version: {old_version} → {new_version}"
tag_message = "{new_version}"
Expand Down
2 changes: 1 addition & 1 deletion src/reuse/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
__version__ = version("reuse")
except PackageNotFoundError:
# package is not installed
__version__ = "3.1.0a1"
__version__ = "4.0.0"

__author__ = "Carmen Bianca Bakker"
__email__ = "[email protected]"
Expand Down
5 changes: 2 additions & 3 deletions src/reuse/comment.py
Original file line number Diff line number Diff line change
Expand Up @@ -847,6 +847,7 @@ class XQueryCommentStyle(CommentStyle):
".clang-tidy": PythonCommentStyle,
".coveragerc": PythonCommentStyle,
".dockerignore": PythonCommentStyle,
".earthlyignore": PythonCommentStyle,
".editorconfig": PythonCommentStyle,
".empty": EmptyCommentStyle,
".eslintignore": PythonCommentStyle,
Expand Down Expand Up @@ -879,6 +880,7 @@ class XQueryCommentStyle(CommentStyle):
"Containerfile": PythonCommentStyle,
"Dockerfile": PythonCommentStyle,
"Doxyfile": PythonCommentStyle,
"Earthfile": PythonCommentStyle,
"Gemfile": PythonCommentStyle,
"go.mod": CppCommentStyle,
"go.sum": UncommentableCommentStyle,
Expand Down Expand Up @@ -919,6 +921,3 @@ def _all_style_classes() -> List[Type[CommentStyle]]:

#: A map of human-friendly names against style classes.
NAME_STYLE_MAP = {style.SHORTHAND: style for style in _result}
# TODO: Remove this for next major 4.0 release.
NAME_STYLE_MAP["csingle"] = CppSingleCommentStyle
NAME_STYLE_MAP["css"] = CCommentStyle
50 changes: 0 additions & 50 deletions tests/test_main_annotate.py
Original file line number Diff line number Diff line change
Expand Up @@ -1574,54 +1574,4 @@ def test_annotate_exit_if_unrecognised(
assert "Jane Doe" not in (fake_repository / "baz/foo.py").read_text()


def test_annotate_csingle(fake_repository, stringio, mock_date_today):
"""Old csingle style is identical to new cppsingle style.

Remove this in the 4.0 major release.
"""
(fake_repository / "csingle.py").write_text("pass")
(fake_repository / "cppsingle.py").write_text("pass")

for style in ["csingle", "cppsingle"]:
main(
[
"annotate",
"--copyright",
"Jane Doe",
"--style",
style,
f"{style}.py",
]
)

assert (fake_repository / "csingle.py").read_text() == (
fake_repository / "cppsingle.py"
).read_text()


def test_annotate_css(fake_repository, stringio, mock_date_today):
"""Old css style is identical to new c style.

Remove this in the 4.0 major release.
"""
(fake_repository / "css.py").write_text("pass")
(fake_repository / "c.py").write_text("pass")

for style in ["css", "c"]:
main(
[
"annotate",
"--copyright",
"Jane Doe",
"--style",
style,
f"{style}.py",
]
)

assert (fake_repository / "css.py").read_text() == (
fake_repository / "c.py"
).read_text()


# REUSE-IgnoreEnd
Loading