Skip to content

Releases: aboutcode-org/commoncode

v31.0.1

24 Feb 01:21
de14126
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v31.0.0...v31.0.1

v31.0.0

24 Aug 17:05
9131627
Compare
Choose a tag to compare

This is a major version with API-breaking changes in the resource module.

  • Drop support for Python 3.6

  • The Resource has no rid (resource id) and no pid (parent id). Instead
    we now use internally a simpler mapping of {path: Resource} object.
    As a result the iteration on a Codebase is faster but this requires more
    memory.

  • The Codebase and VirtualCodebase accepts a new "paths" argument that is list
    of paths. When provided, the Codebase will only contain Resources with these
    paths and no other resources. This handy to create a Codebase with only a
    subset of paths of interest. When we create a Codebase or VirtualCodebase
    with paths, we also always create any intermediate directories. So if you
    ask for a path of "root/dir/file", we create three resources: "root",
    "root/dir" and "root/dir/file". We accumulate codebase errors if the paths
    does not exists in the Codebase or VirtualCodebase. The paths must start with
    the root path segment and must be POSIX paths.

  • When you create a VirtualCodebase with multiple scans, we now prefix each
    scan path with a codebase-1/, codebase-2/, etc. directory in addition to the
    "virtual_root" shared root directory. Otherwise files data was overwritten
    and inconsistent when each location "files" were sharing leading path
    segments. So if you provide to JSON inputs with that each contain the path
    "root/dir/file", the VirtualCodebase will contain these paths:

    • "virtual_root/codebase-1/root/dir/file"
    • "virtual_root/codebase-2/root/dir/file"

    It is otherwise practically impossible to correctly merge file data from
    multiple codebases reliably, so adding this prefix ensures that we are doing
    the right thing

  • The Resource.path now never contains leading or trailing slash. We also
    normalize the path everywhere. In particular this behaviour is visible when
    you create a Codebase with a "full_root" argument. Previously, the paths of a
    "full_root" Codebase were prefixed with a slash "/".

  • When you create a VirtualCodebase with more than one Resource, we now recreate
    the directory tree for any intermediary directory used in a path that is
    otherwise missing from files path list.
    In particular this behaviour changed when you create a VirtualCodebase from
    a previous Codebase created with a "full_root" argument. Previously, the
    missing paths of a "full_root" Codebase were kept unchanged.
    Note that the VirtualCodebase has always ignored the "full_root" argument.

  • The Codebase and VirtualCodebase are now iterable. Iterating on a codebase
    is the same as a top-down walk.

  • The "Codebase.original_location" attributed has been removed.
    No known users of commoncode used this.

  • The Codebase and VirtualCodebase no longer have a "full_root" and
    "strip_root" constructor arguments and attributes. These can still be
    passed but they will be ignored.

    • Resource.path is now always the plain path where the first segment
      is the last segment of the root location, e.g. the root fiename.

    • The Resource now has new "full_root_path" and "strip_root_path"
      properties that return the corresponding paths.

    • The Resource.to_dict and the new Codebase.to_list both have a new
      "full_root" and "strip_root" arguments

    • The Resource.get_path() method accepts "full_root" and "strip_root" arguments.

  • The Resource.create_child() method has been removed.

Other changes:

  • Remove Python upper version limit.

  • Merge latest skeleton

  • fileutils.parent_directory() now accepts a "with_trail" argument.
    The returned directory has a trailing path separator unless with_trail is False.
    The default is True and the default behaviour is unchanged.

  • Add posix_only option to commoncode.paths.portable_filename and
    commoncode.paths.safe_path. This option prevents
    commoncode.paths.portable_filename and commoncode.paths.safe_path from
    replacing filenames and punctuation in filenames that are valid on POSIX
    operating systems, but not Windows.

  • Remove unused intbitset dependency.

What's Changed

Full Changelog: v30.2.0...v31.0.0

v31.0.0b4

17 May 12:32
Compare
Choose a tag to compare
v31.0.0b4 Pre-release
Pre-release
v31.0.0b4

v31.0.0b3

16 May 20:33
Compare
Choose a tag to compare
v31.0.0b3 Pre-release
Pre-release
v31.0.0b3

v31.0.0b2

16 May 20:33
Compare
Choose a tag to compare
v31.0.0b2 Pre-release
Pre-release
v31.0.0b2

v31.0.0b1

16 May 17:31
Compare
Choose a tag to compare
v31.0.0b1 Pre-release
Pre-release

Version 31.0.0 - (2022-05-16)

This is a major version with API-breaking behavious changes in the reosurce
module.

  • The Resource has no rid (resource id) and no pid (parent id). Instead
    we now use internally a simpler mapping of {path: Resource} object.
    As a result the iteration on a Codebase is faster but this requires more
    memory.

  • The Codebase and VirtualCodebase accepts a new "paths" argument that is list
    of paths. When provided, the Codebase will only contain Resources with these
    paths and no other resources. This handy to create a Codebase with only a
    subset of paths of interest. When we create a Codebase or VirtualCodebase
    with paths, we also always create any internediate directories. So if you
    ask for a path of "root/dir/file", we create three resources: "root",
    "root/dir" and "root/dir/file". We accumulate codebase errors if the paths
    does not exists in the Codebase or VirtualCodebase. The paths must start with
    the root path segment and must be POSIX paths.

  • When you create a VirtualCodebase with multiple scans, we now prefix each
    scan path with a codebase-1/, codebase-2/, etc. directory in addition to the
    "virtual_root" shared root directory. Otherwise files data was overwritten
    and inconsistent when each location "files" were sharing leading path
    segments. So if you provide to JSON inputs with that each contain the path
    "root/dir/file", the VirtualCodebase will contain these paths:

    • "virtual_root/codebase-1/root/dir/file"
    • "virtual_root/codebase-2/root/dir/file"
      It is otherwise practically impossble to correctly merge file data from
      multiple codebases reliably, so adding this prefix ensures that we are doing
      the right thing
  • The Resource.path now never contains leading or trailing slash. We also
    normalize the path everywhere. In particular this behaviour is visible when
    you create a Codebase with a "full_root" argument. Previously, the paths of a
    "full_root" Codebase were prefixed with a slash "/".

  • When you create a VirtualCodebase with more than one Resource, we now recreate
    the directory tree for any intermediary directory used in a path that is
    otherwise missing from files path list.
    In particular this behaviour changed when you create a VirtualCodebase from
    a pervious Codebase created with a "full_root" argument. Previously, the
    missing paths of a "full_root" Codebase were kept unchanged.
    Noet that the VirtualCodebase has always ignored the "full_root" argument.

  • The Codebase and VirtualCodebase are now iterable. Iterating on a codebase
    is the same as a top-down walk.

Other changes:

  • Remove Python upper version limit.
  • Merge latest skeleton
  • fileutils.parent_directory() now accepts a "with_trail" argument.
    The returned directory has a trailing path separator unless with_trail is False.
    The default is True and the default behavious is unchanged.

v30.2.0 - 2022-05-02

02 May 07:23
Compare
Choose a tag to compare

This is a minor release that removes upper bounds on dependencies to avoid needless dependency resolution conflicts.

v30.1.2 - 2022-04-29

29 Apr 14:31
Compare
Choose a tag to compare

This is a minor release with improved utilities and a more robust handling of Codebase with a single Resource

v30.1.1 - 2022-04-18

18 Apr 19:05
Compare
Choose a tag to compare

Version 30.1.1 (2022-04-18)

  • Remove usage of deprecated click.get_terminal_size().

v30.1.0 - 2022-04-05

05 Apr 21:29
Compare
Choose a tag to compare

Version 30.1.0 (2022-04-05)

  • Add warning field to commoncode.Codebase headers.
  • Add new functions get_jar_nv() and get_nupkg_nv() that accepts
    a filename of a JAR or nupkg and return a name/version tuple extracted
    using multiple heuristics.