Skip to content
Snippets Groups Projects
  1. Feb 29, 2024
    • Franck Bret's avatar
      from_disk: Add optional progress callback · cebe917a
      Franck Bret authored
      Add an optional progress callback to `from_disk` method. It can
      returns the number of computed entries for each top entries traversed.
      This is useful for CLI, in particular to display progress information
      for SWH Scanner.
      v6.12.1
      cebe917a
  2. Feb 20, 2024
  3. Feb 05, 2024
  4. Jan 09, 2024
    • Pierre-Yves David's avatar
      discovery: support optional callback for information · e54151a4
      Pierre-Yves David authored
      Right now, the discovery process offered by `filter_known_objects`
      returns all results after the discovery is complete. The new callback
      provides a way to get information "in real time" which is useful for at
      least a couple of planned use case in the SWH scanner:
      - displaying progress information while processing
      - update a graphical UI in real time.
      
      This simple callback fits this need without too much troubles.
      
      For some reason, mypy complained about the existing type hint in this
      file for unclear reason. So I fixed them.
      v6.11.0
      e54151a4
    • Pierre-Yves David's avatar
      policy: drop async usage that is now unnecessary · 1a59d42f
      Pierre-Yves David authored
      The web Client is no longer using async so we no longer needs it.
      1a59d42f
  5. Dec 05, 2023
  6. Dec 04, 2023
  7. Dec 03, 2023
  8. Nov 29, 2023
    • Antoine Lambert's avatar
      docs/Makefile: Fix doc build outside tox when using make command · f9c8ec3a
      Antoine Lambert authored
      When building package documentation outside tox by calling make in the
      docs directory, the include of Makefile.sphinx inside the docs Makefile
      was failing as its relative path was invalid.
      
      So adapt this relative path according if the SWH_PACKAGE_DOC_TOX_BUILD
      environment variable is set or not.
      f9c8ec3a
  9. Nov 28, 2023
  10. Nov 16, 2023
  11. Nov 15, 2023
  12. Nov 14, 2023
    • Nicolas Dandrimont's avatar
    • Raphaël Gomès's avatar
      Replace the `dir_filter` with a `path_filter` in `Directory` · 1286c8a4
      Raphaël Gomès authored
      `dir_filter` only filters directories. `swh-scanner` needs to
      accurately filter out ignored files before making expensive requests
      to the web API. We introduce a more general `path_filter` that allows
      us to differentiate between files and folders.
      
      `dir_filter` is now deprecated and will be removed once the remaining
      users in other packages are migrated over to the new API.
      
      `accept_all_directories` is also deprecated, because it only implies
      accepting *directories* even though its behavior also accepts
      non-directory entries when used with `path_filter`.
      1286c8a4
  13. Sep 25, 2023
  14. Aug 29, 2023
  15. Aug 21, 2023
  16. Jul 12, 2023
  17. Jun 14, 2023
  18. Mar 16, 2023
    • Jérémy Bobbio (Lunar)'s avatar
      Add several helper methods returning SWHIDs · 48a46285
      Jérémy Bobbio (Lunar) authored
      This adds several helper methods returning SWHIDs to model objects,
      namely:
      
      - SkippedContent.swhid()
      - DirectoryEntry.swhid()
      - SnapshotBranch.swhid()
      - Release.target_swhid()
      - Revision.directory_swhid() and Release.parent_swhids()
      - OriginVisitStatus.origin_swhid() and
        OriginVisitStatus.snapshot_swhid()
      v6.7.0
      48a46285
  19. Feb 17, 2023
  20. Feb 16, 2023
  21. Feb 13, 2023
    • Antoine Lambert's avatar
      collections: Improve ImmutableDict look up by key performance · d6d17dad
      Antoine Lambert authored
      Previously when looking up data by key in an ImmutableDict, the inner
      tuple storing keys and values was iterated until finding the requested
      key.
      
      This is not really efficient when the ImmutableDict contains a lot of
      entries, typically for an origin snapshot containing a lot of branches.
      
      So use an inner dictionary to speedup look up by key operations and
      improve loader performances.
      v6.6.2
      d6d17dad
  22. Feb 02, 2023
  23. Dec 19, 2022
  24. Dec 15, 2022
    • Antoine Lambert's avatar
      docs/persistent-identifiers: Fix some broken links for browsing SWHIDs · f883e224
      Antoine Lambert authored
      There were two issues that was preventing to browse some SWHIDs given as
      examples in that documentation:
      
      - Some sphinx links were broken in rDMODe1c3fe80731226618616117dfd67a95f3d365645
      
      - A SWHID with ';' in its path qualifier was correctly percent escaped but
        when used as URL argument an extra percent escaping is required as HTTP
        server will unescape URL arguments and thus break SWHID percent escaping.
      
      Closes T4721
      v6.6.1
      f883e224
  25. Dec 05, 2022
  26. Oct 18, 2022
  27. Oct 17, 2022
    • Antoine Lambert's avatar
      model: Fix hypothesis integration with attr < 21.3.0 · dd3bab81
      Antoine Lambert authored
      When using attr < 21.3.0, adding field transformer breaks attrs
      integration with hypothesis, because attributes transformed with
      such function are not casted to generated AttrsClass, but remains
      just an list of attributes. This causes error in hypothesis by
      raising an AttributeError.
      
      As we use attr 21.2.0 in production and when building debian buster
      package, add a workaround for that issue as explained here:
      https://github.com/python-attrs/attrs/issues/821.
      v6.6.0
      dd3bab81
    • Antoine Lambert's avatar
      merkle: Make MerkleNode.collect return a set of nodes instead of a dict · 13e7adc3
      Antoine Lambert authored
      Previously the MerkleNode.collect method was returning a dict whose keys
      are node types and values dict of {<node_hash>: <node_data>}.
      
      In order to give more flexibility to client code for the processing of
      collected nodes, prefer to simply return a set of MerkleNode.
      
      As a consequence, MerkleNode objects need to be hashable by Python so
      the __hash__ method has also been implemented.
      
      Closes T4633
      13e7adc3
  28. Sep 30, 2022
  29. Sep 29, 2022
    • Pierre-Yves David's avatar
      from_disks: fix some of the pattern checking logic · 6a38c4ad
      Pierre-Yves David authored
      The pattern were validated from $PWD and later applied on path relative
      to `root_path`. So we shuffle a bit of code to test them againt
      root_path. We make the absolute pattern relative in the same go.
      
      This code is coming from swh-scanner and should probably get an
      overhaul, how ever for now we start with making it no broken.
      6a38c4ad
  30. Sep 23, 2022
    • Pierre-Yves David's avatar
      model: inline the call to `_check_swhid` · 2d65a24a
      Pierre-Yves David authored
      This reduce the number of function call and should be faster.
      
      The mashup of blind optimisation in the previous changeset yield some
      interesting results in total.
      
      It would be insightful to measure them individually, but that would
      take more time than we currently have.
      
      When testing all the validator changes on our previous "benchmark" we
      see quite interesting improvement.
      
          swh loader run mercurial https://foss.heptapod.net/mercurial/mercurial-devel directory=/data/repos/mercurial-devel
      
      = Median time of 3 run =
      base:   17 minutes 48 seconds
      before: 11 minutes 50 seconds
      after:  11 minutes 11 seconds
      
      On a profile of the same run, the `to_model` call of the from_disk's `Directory` class took the following percentage:
      base:   43%
      before: 15%
      after:  11%
      v6.5.0
      2d65a24a
Loading