promnesia 1.2.20230515__tar.gz → 1.2.20240810__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (240) hide show
  1. promnesia-1.2.20240810/.ci/end2end/.dockerignore +1 -0
  2. promnesia-1.2.20240810/.ci/end2end/Dockerfile +19 -0
  3. promnesia-1.2.20240810/.ci/end2end/build_and_run.sh +20 -0
  4. promnesia-1.2.20240810/.ci/end2end/scripts/build_and_run_tests.sh +15 -0
  5. promnesia-1.2.20240810/.ci/end2end/scripts/setup_chrome.sh +40 -0
  6. promnesia-1.2.20240810/.ci/end2end/scripts/setup_firefox.sh +26 -0
  7. promnesia-1.2.20240810/.ci/end2end/scripts/setup_node.sh +7 -0
  8. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/.ci/release +2 -4
  9. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/.ci/run +1 -1
  10. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/.github/workflows/main.yml +44 -39
  11. promnesia-1.2.20240810/PKG-INFO +53 -0
  12. promnesia-1.2.20240810/benchmarks/20231115.org +17 -0
  13. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/doc/DEVELOPMENT.org +6 -3
  14. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/doc/addons-mozilla-org.org +10 -13
  15. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/extension/.ci/build +0 -1
  16. promnesia-1.2.20240810/extension/__mocks__/browser.js +30 -0
  17. promnesia-1.2.20240810/extension/amo-metadata.json +47 -0
  18. promnesia-1.2.20230515/extension/babel.config.js → promnesia-1.2.20240810/extension/babel.config.cjs +3 -2
  19. promnesia-1.2.20240810/extension/build +161 -0
  20. promnesia-1.2.20240810/extension/eslint.config.js +31 -0
  21. promnesia-1.2.20240810/extension/generate_manifest.js +250 -0
  22. promnesia-1.2.20230515/extension/jest.config.js → promnesia-1.2.20240810/extension/jest.config.cjs +2 -1
  23. {promnesia-1.2.20230515/extension → promnesia-1.2.20240810/extension/old}/flow-typed/webextension-polyfill.js +5 -0
  24. promnesia-1.2.20240810/extension/old/webpack.config.js +380 -0
  25. promnesia-1.2.20240810/extension/package-lock.json +13754 -0
  26. promnesia-1.2.20240810/extension/package.json +61 -0
  27. promnesia-1.2.20240810/extension/rollup.config.js +172 -0
  28. promnesia-1.2.20230515/extension/src/api.js → promnesia-1.2.20240810/extension/src/api.ts +50 -55
  29. promnesia-1.2.20230515/extension/src/background.js → promnesia-1.2.20240810/extension/src/background.ts +209 -197
  30. promnesia-1.2.20240810/extension/src/background_chrome_mv2.js +5 -0
  31. promnesia-1.2.20230515/extension/src/common.js → promnesia-1.2.20240810/extension/src/common.ts +59 -64
  32. promnesia-1.2.20240810/extension/src/compat.ts +24 -0
  33. promnesia-1.2.20230515/extension/src/display.js → promnesia-1.2.20240810/extension/src/display.ts +30 -28
  34. promnesia-1.2.20230515/extension/src/filterlist.js → promnesia-1.2.20240810/extension/src/filterlist.ts +13 -14
  35. promnesia-1.2.20230515/extension/src/normalise.js → promnesia-1.2.20240810/extension/src/normalise.ts +9 -14
  36. promnesia-1.2.20230515/extension/src/notifications.js → promnesia-1.2.20240810/extension/src/notifications.ts +61 -49
  37. promnesia-1.2.20230515/extension/src/options.js → promnesia-1.2.20240810/extension/src/options.ts +33 -38
  38. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/extension/src/options_page.html +4 -4
  39. promnesia-1.2.20230515/extension/src/options_page.js → promnesia-1.2.20240810/extension/src/options_page.ts +30 -55
  40. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/extension/src/search.html +1 -4
  41. promnesia-1.2.20230515/extension/src/search.js → promnesia-1.2.20240810/extension/src/search.ts +14 -15
  42. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/extension/src/selenium_bridge.js +3 -2
  43. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/extension/src/showvisited.js +5 -9
  44. promnesia-1.2.20230515/extension/src/sidebar.js → promnesia-1.2.20240810/extension/src/sidebar.ts +59 -52
  45. promnesia-1.2.20230515/extension/src/sources.js → promnesia-1.2.20240810/extension/src/sources.ts +22 -19
  46. promnesia-1.2.20240810/extension/tests/anchorme.test.js +12 -0
  47. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/extension/tests/common.test.js +5 -5
  48. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/extension/tests/integration.test.js +27 -47
  49. promnesia-1.2.20240810/extension/tsconfig.json +20 -0
  50. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/mypy.ini +6 -4
  51. promnesia-1.2.20240810/ruff.toml +25 -0
  52. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/scripts/browser_history.py +3 -3
  53. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/scripts/promnesia +1 -0
  54. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/setup.py +13 -12
  55. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/src/promnesia/__main__.py +26 -14
  56. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/src/promnesia/cannon.py +4 -4
  57. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/src/promnesia/common.py +39 -28
  58. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/src/promnesia/compare.py +3 -2
  59. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/src/promnesia/config.py +4 -2
  60. promnesia-1.2.20240810/src/promnesia/database/common.py +66 -0
  61. promnesia-1.2.20240810/src/promnesia/database/dump.py +187 -0
  62. promnesia-1.2.20230515/src/promnesia/read_db.py → promnesia-1.2.20240810/src/promnesia/database/load.py +10 -11
  63. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/src/promnesia/extract.py +1 -0
  64. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/src/promnesia/kjson.py +1 -1
  65. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/src/promnesia/logging.py +3 -3
  66. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/src/promnesia/misc/config_example.py +1 -2
  67. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/src/promnesia/misc/install_server.py +2 -3
  68. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/src/promnesia/server.py +18 -19
  69. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/src/promnesia/sources/auto.py +9 -7
  70. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/src/promnesia/sources/browser_legacy.py +11 -5
  71. promnesia-1.2.20240810/src/promnesia/sources/demo.py +36 -0
  72. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/src/promnesia/sources/filetypes.py +7 -0
  73. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/src/promnesia/sources/github.py +2 -2
  74. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/src/promnesia/sources/hypothesis.py +1 -1
  75. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/src/promnesia/sources/markdown.py +15 -15
  76. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/src/promnesia/sources/org.py +7 -3
  77. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/src/promnesia/sources/plaintext.py +3 -1
  78. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/src/promnesia/sources/reddit.py +2 -2
  79. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/src/promnesia/sources/rss.py +1 -1
  80. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/src/promnesia/sources/signal.py +22 -14
  81. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/src/promnesia/sources/stackexchange.py +2 -2
  82. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/src/promnesia/sources/takeout.py +58 -1
  83. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/src/promnesia/sources/takeout_legacy.py +10 -2
  84. promnesia-1.2.20240810/src/promnesia/tests/__init__.py +0 -0
  85. promnesia-1.2.20240810/src/promnesia/tests/common.py +137 -0
  86. promnesia-1.2.20240810/src/promnesia/tests/server_helper.py +64 -0
  87. promnesia-1.2.20240810/src/promnesia/tests/sources/__init__.py +0 -0
  88. promnesia-1.2.20230515/tests/test_auto_indexer.py → promnesia-1.2.20240810/src/promnesia/tests/sources/test_auto.py +9 -10
  89. promnesia-1.2.20240810/src/promnesia/tests/sources/test_filetypes.py +42 -0
  90. promnesia-1.2.20240810/src/promnesia/tests/sources/test_hypothesis.py +39 -0
  91. promnesia-1.2.20230515/tests/test_org_indexer.py → promnesia-1.2.20240810/src/promnesia/tests/sources/test_org.py +16 -9
  92. promnesia-1.2.20240810/src/promnesia/tests/sources/test_plaintext.py +26 -0
  93. promnesia-1.2.20240810/src/promnesia/tests/sources/test_shellcmd.py +22 -0
  94. promnesia-1.2.20240810/src/promnesia/tests/sources/test_takeout.py +58 -0
  95. promnesia-1.2.20230515/tests/cannon.py → promnesia-1.2.20240810/src/promnesia/tests/test_cannon.py +2 -2
  96. promnesia-1.2.20230515/tests/cli.py → promnesia-1.2.20240810/src/promnesia/tests/test_cli.py +11 -18
  97. promnesia-1.2.20240810/src/promnesia/tests/test_compare.py +30 -0
  98. promnesia-1.2.20230515/tests/config_tests.py → promnesia-1.2.20240810/src/promnesia/tests/test_config.py +90 -71
  99. promnesia-1.2.20240810/src/promnesia/tests/test_db_dump.py +223 -0
  100. promnesia-1.2.20240810/src/promnesia/tests/test_extract.py +61 -0
  101. promnesia-1.2.20240810/src/promnesia/tests/test_extract_urls.py +43 -0
  102. promnesia-1.2.20240810/src/promnesia/tests/test_indexer.py +245 -0
  103. promnesia-1.2.20240810/src/promnesia/tests/test_server.py +292 -0
  104. {promnesia-1.2.20230515 → promnesia-1.2.20240810/src/promnesia}/tests/test_traverse.py +11 -13
  105. promnesia-1.2.20240810/src/promnesia/tests/utils.py +35 -0
  106. promnesia-1.2.20240810/src/promnesia.egg-info/PKG-INFO +53 -0
  107. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/src/promnesia.egg-info/SOURCES.txt +71 -44
  108. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/src/promnesia.egg-info/entry_points.txt +0 -1
  109. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/src/promnesia.egg-info/requires.txt +9 -9
  110. promnesia-1.2.20240810/tests/addon.py +364 -0
  111. promnesia-1.2.20240810/tests/addon_helper.py +172 -0
  112. promnesia-1.2.20240810/tests/common.py +69 -0
  113. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/tests/demos.py +13 -10
  114. promnesia-1.2.20240810/tests/end2end_test.py +837 -0
  115. promnesia-1.2.20240810/tests/testdata/auto/orgs/file5.org +4 -0
  116. promnesia-1.2.20240810/tests/webdriver_utils.py +162 -0
  117. promnesia-1.2.20240810/tox.ini +99 -0
  118. promnesia-1.2.20230515/.ci/end2end_tests.Dockerfile +0 -64
  119. promnesia-1.2.20230515/.circleci/config.yml +0 -41
  120. promnesia-1.2.20230515/PKG-INFO +0 -20
  121. promnesia-1.2.20230515/extension/.eslintrc.js +0 -44
  122. promnesia-1.2.20230515/extension/.flowconfig +0 -15
  123. promnesia-1.2.20230515/extension/build +0 -119
  124. promnesia-1.2.20230515/extension/package-lock.json +0 -26095
  125. promnesia-1.2.20230515/extension/package.json +0 -72
  126. promnesia-1.2.20230515/extension/src/manifest.json +0 -14
  127. promnesia-1.2.20230515/extension/webpack.config.js +0 -300
  128. promnesia-1.2.20230515/src/promnesia/dump.py +0 -105
  129. promnesia-1.2.20230515/src/promnesia/sources/demo.py +0 -20
  130. promnesia-1.2.20230515/src/promnesia.egg-info/PKG-INFO +0 -20
  131. promnesia-1.2.20230515/tests/browser_helper.py +0 -119
  132. promnesia-1.2.20230515/tests/common.py +0 -100
  133. promnesia-1.2.20230515/tests/end2end_test.py +0 -1293
  134. promnesia-1.2.20230515/tests/imports.py +0 -33
  135. promnesia-1.2.20230515/tests/indexer_test.py +0 -297
  136. promnesia-1.2.20230515/tests/integration_test.py +0 -291
  137. promnesia-1.2.20230515/tests/server_test.py +0 -257
  138. promnesia-1.2.20230515/tests/test_misc.py +0 -84
  139. promnesia-1.2.20230515/tests/webdriver_utils.py +0 -43
  140. promnesia-1.2.20230515/tox.ini +0 -90
  141. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/.ci/fake-systemd/systemctl +0 -0
  142. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/.ci/github-ci-compat +0 -0
  143. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/.dockerignore +0 -0
  144. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/.gitignore +0 -0
  145. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/.gitmodules +0 -0
  146. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/CHANGELOG.org +0 -0
  147. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/LICENSE +0 -0
  148. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/README.org +0 -0
  149. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/ci/run-github-locally +0 -0
  150. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/doc/GUIDE.org +0 -0
  151. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/doc/PRIVACY.org +0 -0
  152. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/doc/SOURCES.org +0 -0
  153. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/doc/TROUBLESHOOTING.org +0 -0
  154. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/doc/config.py +0 -0
  155. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/docker/.gitignore +0 -0
  156. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/docker/docker_files/Dockerfile +0 -0
  157. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/docker/docker_files/Dockerfile-indexer +0 -0
  158. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/docker/docker_files/docker-compose.yaml +0 -0
  159. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/docker/docker_files/indexer-config.py.example +0 -0
  160. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/docker/docker_files/indexer-entrypoint.sh +0 -0
  161. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/docker/get-some-data.sh +0 -0
  162. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/docker/init.sh +0 -0
  163. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/docker/start.sh +0 -0
  164. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/extension/.editorconfig +0 -0
  165. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/extension/MANUAL-TESTS.org +0 -0
  166. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/extension/TODO.org +0 -0
  167. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/extension/__mocks__/dom-form-serializer.js +0 -0
  168. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/extension/old/patcher.js +0 -0
  169. {promnesia-1.2.20230515/extension → promnesia-1.2.20240810/extension/src}/images/generate +0 -0
  170. {promnesia-1.2.20230515/extension → promnesia-1.2.20240810/extension/src}/images/ic_blacklisted_48.png +0 -0
  171. {promnesia-1.2.20230515/extension → promnesia-1.2.20240810/extension/src}/images/ic_blue_48.png +0 -0
  172. {promnesia-1.2.20230515/extension → promnesia-1.2.20240810/extension/src}/images/ic_boring_48.png +0 -0
  173. {promnesia-1.2.20230515/extension → promnesia-1.2.20240810/extension/src}/images/ic_error.png +0 -0
  174. {promnesia-1.2.20230515/extension → promnesia-1.2.20240810/extension/src}/images/ic_not_visited_48.png +0 -0
  175. {promnesia-1.2.20230515/extension → promnesia-1.2.20240810/extension/src}/images/ic_relatives_48.png +0 -0
  176. {promnesia-1.2.20230515/extension → promnesia-1.2.20240810/extension/src}/images/ic_visited_48.png +0 -0
  177. {promnesia-1.2.20230515/extension → promnesia-1.2.20240810/extension/src}/images/source_48.svg +0 -0
  178. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/extension/src/options_page.css +0 -0
  179. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/extension/src/showvisited.css +0 -0
  180. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/extension/src/sidebar-outer.css +0 -0
  181. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/extension/src/sidebar.css +0 -0
  182. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/extension/src/toastify.css +0 -0
  183. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/extension/src/toastify.js +0 -0
  184. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/extension/tests/defensify.test.js +0 -0
  185. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/extension/tests/test.html +0 -0
  186. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/pytest.ini +0 -0
  187. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/scripts/backup-phone-history.sh +0 -0
  188. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/setup.cfg +0 -0
  189. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/src/promnesia/__init__.py +0 -0
  190. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/src/promnesia/compat.py +0 -0
  191. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/src/promnesia/misc/__init__.pyi +0 -0
  192. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/src/promnesia/py.typed +0 -0
  193. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/src/promnesia/sources/__init__.pyi +0 -0
  194. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/src/promnesia/sources/auto_logseq.py +0 -0
  195. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/src/promnesia/sources/auto_obsidian.py +0 -0
  196. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/src/promnesia/sources/browser.py +0 -0
  197. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/src/promnesia/sources/fbmessenger.py +0 -0
  198. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/src/promnesia/sources/guess.py +0 -0
  199. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/src/promnesia/sources/hackernews.py +0 -0
  200. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/src/promnesia/sources/hpi.py +0 -0
  201. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/src/promnesia/sources/html.py +0 -0
  202. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/src/promnesia/sources/instapaper.py +0 -0
  203. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/src/promnesia/sources/pocket.py +0 -0
  204. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/src/promnesia/sources/roamresearch.py +0 -0
  205. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/src/promnesia/sources/shellcmd.py +0 -0
  206. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/src/promnesia/sources/smscalls.py +0 -0
  207. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/src/promnesia/sources/telegram.py +0 -0
  208. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/src/promnesia/sources/telegram_legacy.py +0 -0
  209. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/src/promnesia/sources/twitter.py +0 -0
  210. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/src/promnesia/sources/vcs.py +0 -0
  211. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/src/promnesia/sources/viber.py +0 -0
  212. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/src/promnesia/sources/website.py +0 -0
  213. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/src/promnesia/sources/zulip.py +0 -0
  214. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/src/promnesia/sqlite.py +0 -0
  215. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/src/promnesia.egg-info/dependency_links.txt +0 -0
  216. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/src/promnesia.egg-info/not-zip-safe +0 -0
  217. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/src/promnesia.egg-info/top_level.txt +0 -0
  218. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/tests/convert_screencast.py +0 -0
  219. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/tests/install_and_run +0 -0
  220. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/tests/record.py +0 -0
  221. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/tests/testdata/auto/orgs/file.org +0 -0
  222. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/tests/testdata/auto/orgs/file2.org +0 -0
  223. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/tests/testdata/auto/orgs/file3.org +0 -0
  224. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/tests/testdata/auto/orgs/file4.org +0 -0
  225. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/tests/testdata/auto/pocket.json +0 -0
  226. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/tests/testdata/custom/file1.txt +0 -0
  227. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/tests/testdata/custom/file2.txt +0 -0
  228. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/tests/testdata/logseq-graph/logseq/config.edn +0 -0
  229. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/tests/testdata/logseq-graph/pages/Note.md +0 -0
  230. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/tests/testdata/normalise/ff.txt +0 -0
  231. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/tests/testdata/obsidian-vault/.obsidian/app.json +0 -0
  232. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/tests/testdata/obsidian-vault/Note.md +0 -0
  233. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/tests/testdata/takeout/Takeout/My Activity/Chrome/MyActivity.html +0 -0
  234. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/tests/testdata/takeout-20150518T000000Z.zip +0 -0
  235. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/tests/testdata/test_config.py +0 -0
  236. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/tests/testdata/traverse/ignoreme.txt +0 -0
  237. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/tests/testdata/traverse/ignoreme2/notrealignored.txt +0 -0
  238. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/tests/testdata/traverse/imhere.txt +0 -0
  239. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/tests/testdata/traverse/imhere2/real.txt +0 -0
  240. {promnesia-1.2.20230515 → promnesia-1.2.20240810}/tests/testdata/weird.txt +0 -0
@@ -0,0 +1 @@
1
+ build_and_run.sh
@@ -0,0 +1,19 @@
1
+ FROM ubuntu:latest
2
+
3
+ ENV DEBIAN_FRONTEND=noninteractive
4
+
5
+ COPY scripts /scripts
6
+
7
+ RUN /scripts/setup_firefox.sh \
8
+ && /scripts/setup_chrome.sh \
9
+ && /scripts/setup_node.sh \
10
+ && apt install --yes tox git \
11
+ # using python docs as a source of some html test data
12
+ # need to prevent dpkg from excluding doc files...
13
+ && sed -i '/usr.share.doc/d' /etc/dpkg/dpkg.cfg.d/excludes && apt install --yes python3-doc \
14
+ && apt clean \
15
+ && mkdir /promnesia
16
+
17
+ WORKDIR /promnesia
18
+
19
+ ENTRYPOINT ["/scripts/build_and_run_tests.sh"]
@@ -0,0 +1,20 @@
1
+ #!/bin/bash
2
+ set -eux
3
+
4
+ # TODO assert we're running under github ci?
5
+ # since this setup is kinda elaborate and can be somewhat unsafe to run blindly
6
+
7
+ # supposed to be called from promnesia repository root
8
+ [ -e src/promnesia ]
9
+ [ -e extension/src ]
10
+
11
+ PROMNESIA_SRC="$(pwd)"
12
+
13
+ cd .ci/end2end
14
+
15
+ IMAGE='promnesia_end2end_tests'
16
+
17
+ docker build -t "$IMAGE" .
18
+
19
+ # NOTE: dev/shm mount to prevent crashes during headless chrome
20
+ docker run -v /dev/shm:/dev/shm --mount "type=bind,src=$PROMNESIA_SRC,dst=/promnesia_source,readonly=true" -e CI "$IMAGE" "$@"
@@ -0,0 +1,15 @@
1
+ #!/bin/bash
2
+ set -eux
3
+
4
+ # Seems wrong to keep the whole repository in docker build context.
5
+ # So instead, we mount the repository inside the container (into /promnesia_source)
6
+ # (as read only to avoid messing up host files and crapping with caches etc.)
7
+ # However to actually run tests we do need a writable directory..
8
+ # So we copy the repo to the actual working dir here
9
+
10
+ # ugh, kinda annoying -- not sure how to update source files when we change them on the host system...
11
+ cp -R -T /promnesia_source /promnesia
12
+ extension/.ci/build
13
+
14
+ git init # todo ??? otherwise setuptools-scm fails to detect the version...
15
+ python3 -m tox -e end2end -- "$@"
@@ -0,0 +1,40 @@
1
+ #!/bin/bash
2
+ set -eux -o pipefail
3
+
4
+ apt update --yes
5
+
6
+ apt install --yes wget
7
+
8
+ install -d -m 0755 /etc/apt/keyrings
9
+ wget -q https://dl.google.com/linux/linux_signing_key.pub -O- | tee /etc/apt/keyrings/linux_signing_key.pub.asc > /dev/null
10
+ echo "deb [signed-by=/etc/apt/keyrings/linux_signing_key.pub.asc] https://dl.google.com/linux/chrome/deb/ stable main" | tee -a /etc/apt/sources.list.d/google-chrome.list > /dev/null
11
+
12
+ apt update
13
+
14
+ apt install --yes google-chrome-stable
15
+
16
+ # sadly latest version of chrome/chromedriver isn't working due to some bugs with iframes (see install_custom_chrome)
17
+
18
+ # remove the actual chrome to get it out of the way (we do want dependencies though)
19
+ apt remove --yes google-chrome-stable
20
+ ! which google-chrome # check there is no binary (in case of virtual packages or whatever)
21
+
22
+ function install_custom_chrome() {
23
+ ## this installs last revision that was actually working (1110897) or 113.0.5623.0
24
+ ## see https://bugs.chromium.org/p/chromedriver/issues/detail?id=4440
25
+ apt install --yes unzip
26
+
27
+ mkdir /tmp/chrome
28
+
29
+ wget -q 'https://www.googleapis.com/download/storage/v1/b/chromium-browser-snapshots/o/Linux_x64%2F1110897%2Fchrome-linux.zip?generation=1677589092014487&alt=media' \
30
+ -O /tmp/chrome/chrome-linux.zip
31
+ unzip /tmp/chrome/chrome-linux.zip -d /tmp/chrome
32
+ ln -sf /tmp/chrome/chrome-linux/chrome /usr/bin/google-chrome
33
+
34
+ wget -q 'https://www.googleapis.com/download/storage/v1/b/chromium-browser-snapshots/o/Linux_x64%2F1110897%2Fchromedriver_linux64.zip?generation=1677589097630198&alt=media' \
35
+ -O /tmp/chrome/chromedriver_linux64.zip
36
+ unzip /tmp/chrome/chromedriver_linux64.zip -d /tmp/chrome
37
+ ln -sf /tmp/chrome/chromedriver_linux64/chromedriver /usr/bin/chromedriver
38
+ }
39
+
40
+ install_custom_chrome
@@ -0,0 +1,26 @@
1
+ #!/bin/bash
2
+ set -eux -o pipefail
3
+
4
+ apt update --yes
5
+
6
+ apt install --yes wget
7
+
8
+ # NOTE: these days ubuntu provisions firefox via snap, and it's a nightmare to make it work with webdriver
9
+ # so we force it to use a regular package (following these instructions https://askubuntu.com/a/1510872/427470)
10
+ install -d -m 0755 /etc/apt/keyrings
11
+ wget -q https://packages.mozilla.org/apt/repo-signing-key.gpg -O- | tee /etc/apt/keyrings/packages.mozilla.org.asc > /dev/null
12
+ echo "deb [signed-by=/etc/apt/keyrings/packages.mozilla.org.asc] https://packages.mozilla.org/apt mozilla main" | tee -a /etc/apt/sources.list.d/mozilla.list > /dev/null
13
+
14
+ # prevent snap version from overriding:
15
+ echo '
16
+ Package: *
17
+ Pin: origin packages.mozilla.org
18
+ Pin-Priority: 1000
19
+ ' | tee /etc/apt/preferences.d/mozilla
20
+ # to check: -- should not show anything mentioning snap
21
+ # apt install --verbose-versions --dry-run firefox
22
+
23
+ apt update
24
+
25
+ apt install --yes firefox
26
+ # NOTE: selenium should download the corresponding geckodriver itself via selenium_manager
@@ -0,0 +1,7 @@
1
+ #!/bin/bash
2
+ set -eux -o pipefail
3
+
4
+ apt update --yes
5
+ apt install --yes curl
6
+ curl -fsSL https://deb.nodesource.com/setup_20.x | bash -
7
+ apt install --yes nodejs
@@ -19,10 +19,8 @@ from pathlib import Path
19
19
  from subprocess import check_call
20
20
  import shutil
21
21
 
22
-
23
22
  is_ci = os.environ.get('CI') is not None
24
23
 
25
-
26
24
  def main() -> None:
27
25
  import argparse
28
26
  p = argparse.ArgumentParser()
@@ -31,7 +29,7 @@ def main() -> None:
31
29
 
32
30
  extra = []
33
31
  if args.test:
34
- extra.extend(['--repository-url', 'https://test.pypi.org/legacy/'])
32
+ extra.extend(['--repository', 'testpypi'])
35
33
 
36
34
  root = Path(__file__).absolute().parent.parent
37
35
  os.chdir(root) # just in case
@@ -44,7 +42,7 @@ def main() -> None:
44
42
  if dist.exists():
45
43
  shutil.rmtree(dist)
46
44
 
47
- check_call('python3 setup.py sdist bdist_wheel', shell=True)
45
+ check_call(['python3', '-m', 'build'])
48
46
 
49
47
  TP = 'TWINE_PASSWORD'
50
48
  password = os.environ.get(TP)
@@ -45,4 +45,4 @@ if ! command -v python3 &> /dev/null; then
45
45
  fi
46
46
 
47
47
  "$PY_BIN" -m pip install --user tox
48
- "$PY_BIN" -m tox
48
+ "$PY_BIN" -m tox --parallel --parallel-live "$@"
@@ -9,24 +9,32 @@ on:
9
9
  pull_request: # needed to trigger on others' PRs
10
10
  # Note that people who fork it need to go to "Actions" tab on their fork and click "I understand my workflows, go ahead and enable them".
11
11
  workflow_dispatch: # needed to trigger workflows manually
12
+ # todo cron?
13
+ inputs:
14
+ debug_enabled:
15
+ type: boolean
16
+ description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)'
17
+ required: false
18
+ default: false
12
19
 
13
20
 
14
21
  jobs:
15
22
  build:
16
23
  strategy:
17
- # useful to quickly debug all versions, otherwise a bit wasteful
18
- # fail-fast: false
24
+ fail-fast: false
19
25
  matrix:
20
26
  platform: [ubuntu-latest, macos-latest, windows-latest]
21
- python-version: ['3.8', '3.9', '3.10', '3.11']
27
+ python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
22
28
  exclude: [
23
29
  # windows runners are pretty scarce, so let's only run lowest and highest python version
24
- {platform: windows-latest, python-version: '3.9'},
30
+ {platform: windows-latest, python-version: '3.9' },
25
31
  {platform: windows-latest, python-version: '3.10'},
32
+ {platform: windows-latest, python-version: '3.11'},
26
33
 
27
34
  # same, macos is a bit too slow and ubuntu covers python quirks well
28
35
  {platform: macos-latest , python-version: '3.9' },
29
- {platform: macos-latest , python-version: '3.10' },
36
+ {platform: macos-latest , python-version: '3.10'},
37
+ {platform: macos-latest , python-version: '3.11'},
30
38
  ]
31
39
 
32
40
  runs-on: ${{ matrix.platform }}
@@ -36,31 +44,29 @@ jobs:
36
44
  steps:
37
45
  # ugh https://github.com/actions/toolkit/blob/main/docs/commands.md#path-manipulation
38
46
  - run: echo "$HOME/.local/bin" >> $GITHUB_PATH
39
- - if: ${{ matrix.platform == 'macos-latest' && matrix.python-version == '3.11' }}
40
- # hmm somehow only seems necessary for 3.11 on osx??
41
- run: echo "$HOME/Library/Python/${{ matrix.python-version }}/bin" >> $GITHUB_PATH
42
47
 
43
- - uses: actions/setup-python@v4
48
+ - uses: actions/setup-python@v5
44
49
  with:
45
50
  python-version: ${{ matrix.python-version }}
46
51
 
47
- - uses: actions/checkout@v3
52
+ - uses: actions/checkout@v4
48
53
  with:
49
54
  submodules: recursive
50
-
51
- # uncomment for SSH debugging
52
- # - uses: mxschmitt/action-tmate@v3
55
+ fetch-depth: 0 # nicer to have all git history when debugging/for tests
56
+
57
+ - uses: mxschmitt/action-tmate@v3
58
+ if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }}
53
59
 
54
60
  # explicit bash command is necessary for Windows CI runner, otherwise it thinks it's cmd...
55
61
  - run: bash .ci/run
56
62
 
57
63
  - if: matrix.platform == 'ubuntu-latest' # no need to compute coverage for other platforms
58
- uses: actions/upload-artifact@v3
64
+ uses: actions/upload-artifact@v4
59
65
  with:
60
66
  name: .coverage.mypy-core_${{ matrix.platform }}_${{ matrix.python-version }}
61
67
  path: .coverage.mypy-core/
62
68
  - if: matrix.platform == 'ubuntu-latest' # no need to compute coverage for other platforms
63
- uses: actions/upload-artifact@v3
69
+ uses: actions/upload-artifact@v4
64
70
  with:
65
71
  name: .coverage.mypy-misc_${{ matrix.platform }}_${{ matrix.python-version }}
66
72
  path: .coverage.mypy-misc/
@@ -69,24 +75,22 @@ jobs:
69
75
  end2end_tests_chrome:
70
76
  runs-on: ubuntu-latest
71
77
  steps:
72
- - uses: actions/checkout@v3
78
+ - uses: actions/checkout@v4
73
79
  with:
74
80
  submodules: recursive
75
- # NOTE: dev/shm mount to prevent crashes during headless chrome
76
- - run: |
77
- docker build -f .ci/end2end_tests.Dockerfile . -t promnesia_end2end_tests
78
- docker run -v /dev/shm:/dev/shm -e CI promnesia_end2end_tests -- -k chrome
81
+ - uses: mxschmitt/action-tmate@v3
82
+ if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }}
83
+ - run: .ci/end2end/build_and_run.sh -k chrome
79
84
 
80
85
  end2end_tests_firefox:
81
86
  runs-on: ubuntu-latest
82
87
  steps:
83
- - uses: actions/checkout@v3
88
+ - uses: actions/checkout@v4
84
89
  with:
85
90
  submodules: recursive
86
- # NOTE: dev/shm mount to prevent crashes during headless chrome
87
- - run: |
88
- docker build -f .ci/end2end_tests.Dockerfile . -t promnesia_end2end_tests
89
- docker run -v /dev/shm:/dev/shm -e CI promnesia_end2end_tests -- -k firefox
91
+ - uses: mxschmitt/action-tmate@v3
92
+ if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }}
93
+ - run: .ci/end2end/build_and_run.sh -k firefox
90
94
 
91
95
  install_and_run_test:
92
96
  # todo use setup-python thing?
@@ -94,7 +98,7 @@ jobs:
94
98
  runs-on: ubuntu-latest
95
99
 
96
100
  steps:
97
- - uses: actions/checkout@v3
101
+ - uses: actions/checkout@v4
98
102
  with:
99
103
  submodules: recursive
100
104
 
@@ -115,11 +119,11 @@ jobs:
115
119
  # ugh https://github.com/actions/toolkit/blob/main/docs/commands.md#path-manipulation
116
120
  - run: echo "$HOME/.local/bin" >> $GITHUB_PATH
117
121
 
118
- - uses: actions/setup-python@v4
122
+ - uses: actions/setup-python@v5
119
123
  with:
120
- python-version: '3.8'
124
+ python-version: '3.10'
121
125
 
122
- - uses: actions/checkout@v3
126
+ - uses: actions/checkout@v4
123
127
  with:
124
128
  submodules: recursive
125
129
 
@@ -128,8 +132,7 @@ jobs:
128
132
  if: github.event_name != 'pull_request' && github.event.ref == 'refs/heads/master'
129
133
  env:
130
134
  TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD_TEST }}
131
- run: pip3 install --user wheel twine && .ci/release --test
132
- # TODO run pip install just to test?
135
+ run: pip3 install --user --upgrade build twine && .ci/release --test
133
136
 
134
137
  - name: 'release to pypi'
135
138
  # always deploy tags to release pypi
@@ -137,7 +140,7 @@ jobs:
137
140
  if: github.event_name != 'pull_request' && startsWith(github.event.ref, 'refs/tags')
138
141
  env:
139
142
  TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
140
- run: pip3 install --user wheel twine && .ci/release
143
+ run: pip3 install --user --upgrade build twine && .ci/release
141
144
 
142
145
  ###
143
146
  build_extension:
@@ -145,31 +148,33 @@ jobs:
145
148
  name: 'promnesia'
146
149
  runs-on: ubuntu-latest
147
150
  steps:
148
- - uses: actions/checkout@v3
151
+ - uses: actions/checkout@v4
149
152
  with:
150
153
  submodules: recursive
151
- - uses: actions/setup-node@v3
154
+ fetch-depth: 0 # nicer to have all git history when debugging/for tests
155
+
156
+ - uses: actions/setup-node@v4
152
157
  with:
153
- node-version: '18'
158
+ node-version: '20'
154
159
 
155
160
  - run: extension/.ci/build --lint # debug version
156
161
  - run: extension/.ci/build --lint --release
157
162
 
158
163
  # TODO ugh. can't share github actions artifacts publicly...
159
164
  # TODO for fuck's sake... why does it end up named as .zip.zip ????
160
- - uses: actions/upload-artifact@v3
165
+ - uses: actions/upload-artifact@v4
161
166
  with:
162
167
  name: '${{ env.name }}-chrome-debug-latest.zip'
163
168
  path: 'extension/dist/artifacts/chrome/${{ env.name }}_dev_-*.zip'
164
- - uses: actions/upload-artifact@v3
169
+ - uses: actions/upload-artifact@v4
165
170
  with:
166
171
  name: '${{ env.name }}-chrome-release-latest.zip'
167
172
  path: 'extension/dist/artifacts/chrome/${{ env.name }}-*.zip'
168
- - uses: actions/upload-artifact@v3
173
+ - uses: actions/upload-artifact@v4
169
174
  with:
170
175
  name: '${{ env.name }}-firefox-debug-latest.zip'
171
176
  path: 'extension/dist/artifacts/firefox/${{ env.name }}_dev_-*.zip'
172
- - uses: actions/upload-artifact@v3
177
+ - uses: actions/upload-artifact@v4
173
178
  with:
174
179
  name: '${{ env.name }}-firefox-release-latest.zip'
175
180
  path: 'extension/dist/artifacts/firefox/${{ env.name }}-*.zip'
@@ -0,0 +1,53 @@
1
+ Metadata-Version: 2.1
2
+ Name: promnesia
3
+ Version: 1.2.20240810
4
+ Summary: Enhancement of your browsing history
5
+ Home-page: https://github.com/karlicoss/promnesia
6
+ Author: Dmitrii Gerasimov
7
+ Author-email: karlicoss@gmail.com
8
+ Requires-Python: >=3.8
9
+ License-File: LICENSE
10
+ Requires-Dist: appdirs
11
+ Requires-Dist: tzlocal
12
+ Requires-Dist: more_itertools
13
+ Requires-Dist: pytz
14
+ Requires-Dist: sqlalchemy>=2.0
15
+ Requires-Dist: urlextract
16
+ Requires-Dist: fastapi
17
+ Requires-Dist: uvicorn[standard]
18
+ Provides-Extra: testing
19
+ Requires-Dist: pytest; extra == "testing"
20
+ Requires-Dist: pytest-timeout; extra == "testing"
21
+ Requires-Dist: pytest-xdist; extra == "testing"
22
+ Requires-Dist: hypothesis; extra == "testing"
23
+ Requires-Dist: psutil; extra == "testing"
24
+ Requires-Dist: requests; extra == "testing"
25
+ Requires-Dist: selenium; extra == "testing"
26
+ Requires-Dist: click; extra == "testing"
27
+ Requires-Dist: ruff; extra == "testing"
28
+ Requires-Dist: mypy; extra == "testing"
29
+ Requires-Dist: lxml; extra == "testing"
30
+ Requires-Dist: loguru; extra == "testing"
31
+ Provides-Extra: testing-gui
32
+ Requires-Dist: pyautogui; extra == "testing-gui"
33
+ Provides-Extra: optional
34
+ Requires-Dist: logzero; extra == "optional"
35
+ Requires-Dist: python-magic; extra == "optional"
36
+ Provides-Extra: hpi
37
+ Requires-Dist: HPI; extra == "hpi"
38
+ Provides-Extra: html
39
+ Requires-Dist: beautifulsoup4; extra == "html"
40
+ Requires-Dist: lxml; extra == "html"
41
+ Provides-Extra: markdown
42
+ Requires-Dist: mistletoe; extra == "markdown"
43
+ Provides-Extra: org
44
+ Requires-Dist: orgparse>=0.3.0; extra == "org"
45
+ Provides-Extra: telegram
46
+ Provides-Extra: all
47
+ Requires-Dist: logzero; extra == "all"
48
+ Requires-Dist: python-magic; extra == "all"
49
+ Requires-Dist: HPI; extra == "all"
50
+ Requires-Dist: beautifulsoup4; extra == "all"
51
+ Requires-Dist: lxml; extra == "all"
52
+ Requires-Dist: mistletoe; extra == "all"
53
+ Requires-Dist: orgparse>=0.3.0; extra == "all"
@@ -0,0 +1,17 @@
1
+ Running on @karlicoss desktop PC, =python3.10= (under docker)
2
+
3
+ - dumping via cachew NTBinder, using regular sqlalchemy insert statement
4
+
5
+ #+begin_example
6
+ $ python3 -m pytest --import-mode=importlib --pyargs promnesia.tests -s -k 'gc_off and benchmark and 100000'
7
+ 12.90s call src/promnesia/tests/test_db_dump.py::test_benchmark_visits_dumping[gc_off-100000]
8
+ PASSED src/promnesia/tests/test_db_dump.py::test_benchmark_visits_dumping[gc_off-100000]
9
+ #+end_example
10
+
11
+
12
+ - dumping via cachew NTBinder, using dbengine to insert directly -- massive speedup (added a test with 1M visits too)
13
+ #+begin_example
14
+ $ python3 -m pytest --import-mode=importlib --pyargs promnesia.tests -s -k 'gc_off and benchmark and 100000'
15
+ 0.85s call src/promnesia/tests/test_db_dump.py::test_benchmark_visits_dumping[gc_off-100000]
16
+ 8.23s call src/promnesia/tests/test_db_dump.py::test_benchmark_visits_dumping[gc_off-1000000]
17
+ #+end_example
@@ -61,7 +61,7 @@ I'm not against it, but with limited time resources full-scale tests give better
61
61
 
62
62
  * Run end-to-end tests
63
63
 
64
- End-to-end test go thought the full cycle from indexing & backend to automated extension tests, and are very helpful to make sure you don't break things.
64
+ End-to-end tests go through the full cycle from indexing & backend to automated extension tests, and are very helpful to make sure you don't break things.
65
65
 
66
66
  You need:
67
67
 
@@ -74,18 +74,21 @@ Example of running a test:
74
74
 
75
75
  You can also run them via tox:
76
76
 
77
+ # TODO https://github.com/tox-dev/tox/discussions/2681
77
78
  : TOX_TESTENV_PASSENV='DISPLAY HOME' tox -e end2end -- -s -k 'test_blacklist_custom[firefox]'
78
79
 
79
80
  - it's useful to pass =--pdb= to pytest, so you don't have to restart webdriver all over
80
81
  - after initial run, it's best pass =--skip-pkg-install= to tox to speedup repetitive test runs
81
82
  - when you're in development/debugging process, perhaps best to run the firefox version of tests -- Chrome has a 5-ish seconds lag after installing the extension
83
+ - since these tests can be quite slow, you can benefit from installing =pytest-xdist= plugin and using =-n= flag to parallelize
84
+ - to debug flaky tests, it's useful to install =pytest-repeat= in addition, e.g. =--repeat=5 -n 5=
82
85
 
83
86
  * Releasing
84
87
  ** AMO (addons.mozilla.org)
85
88
 
86
89
  : cd extension
87
90
  : npm install # (if necessary)
88
- : ./build --firefox --lint --release --publish
91
+ : ./build --firefox --lint --release --publish listed
89
92
 
90
93
  Note that this will only upload the extension (see [[https://extensionworkshop.com/documentation/develop/web-ext-command-reference/#channel][web-ext sign command reference]] and [[https://github.com/fregante/web-ext-submit#readme][web-ext-submit]] for more info).
91
94
  You need go to https://addons.mozilla.org/en-GB/developers/addon/promnesia/versions, there you should see your extension as 'pending approval'. Usually it's approved within minutes.
@@ -97,7 +100,7 @@ For build instructions, you can point the reviewers at [[file:addons-mozilla-org
97
100
  ** CWS (chrome web store)
98
101
  : cd extension
99
102
  : npm install # (if necessary)
100
- : ./build --chrome --lint --release --publish
103
+ : ./build --chrome --lint --release --publish listed
101
104
 
102
105
  This command should work in theory and upload automatically... however getting the api keys is super annoying (see [[https://github.com/DrewML/chrome-webstore-upload/blob/master/How%20to%20generate%20Google%20API%20keys.md][this]]).
103
106
 
@@ -4,20 +4,20 @@ To provide the source code, run: =git archive master --output=promnesia-source.z
4
4
 
5
5
  Also can point them at https://github.com/karlicoss/promnesia/tree/master/extension
6
6
 
7
- The build instruction assume that the zip file with source code is in =/path/to/promnesia-source.zip= (on the HOST system).
7
+ The build instructions assume that the zip file with source code is in =/path/to/promnesia-source.zip= (on the HOST system).
8
8
  *Make sure to replace it with the actual path to the source code zip file.*
9
9
 
10
10
 
11
11
  * Building addon
12
12
 
13
- To build you need *Ubuntu 22.04/Jammy* and *Node 18*. The easiest way to build cleanly would be a Docker container:
13
+ To build you need *Ubuntu 24.04/Noble* and *Node 20*. The easiest way to build cleanly would be a Docker container:
14
14
 
15
15
  #+begin_src
16
16
  # on the HOST system: cleanup previous container -- if it didn't exist in the first, it will show an error, ignore it
17
17
  docker rm -f promnesia_build
18
18
 
19
19
  # on the HOST system: create the container
20
- docker create --name promnesia_build -it ubuntu:jammy /bin/bash
20
+ docker create --name promnesia_build -it ubuntu:noble /bin/bash
21
21
 
22
22
  # on the HOST system: put the sources into the container
23
23
  docker cp /path/to/promnesia-source.zip promnesia_build:/promnesia.zip
@@ -25,29 +25,26 @@ docker cp /path/to/promnesia-source.zip promnesia_build:/promnesia.zip
25
25
  # on the HOST system: start the container
26
26
  docker start -i promnesia_build
27
27
 
28
- # INSIDE the container
29
- $ apt update && apt install -y sudo
30
-
31
28
  #+end_src
32
29
 
33
30
  After that build the addon (run these commands INSIDE the container if you choose to do it with Docker):
34
31
 
35
32
  #+begin_src
36
- $ sudo apt update && sudo apt install -y git curl unzip
37
- $ curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
38
- $ sudo apt install -y nodejs
33
+ $ apt update && apt install -y git curl unzip
34
+ $ curl -fsSL https://deb.nodesource.com/setup_20.x | bash -
35
+ $ DEBIAN_FRONTEND=noninteractive apt install -y nodejs
39
36
  $ unzip promnesia.zip -d promnesia
40
- $ cd promnesia/extension/
37
+ $ cd promnesia
41
38
  $ npm install
42
- $ ./build --firefox --release --lint
39
+ $ ./build --firefox --release --lint --publish=skip
43
40
  #+end_src
44
41
 
45
- The final artifact will be in =/promnesia/extension/dist/artifacts/firefox/promnesia-<version>.zip= (INSIDE the container).
42
+ The final artifact will be in =/promnesia/dist/artifacts/firefox/promnesia-<version>.zip= (INSIDE the container).
46
43
 
47
44
  If you need to get it back onto the HOST system (e.g. to test in the browser), run on the HOST system (e.g. in a separate terminal):
48
45
 
49
46
  #+begin_src
50
- docker cp promnesia_build:/promnesia/extension/dist/artifacts/firefox/promnesia-<version>.zip .
47
+ docker cp promnesia_build:/promnesia/dist/artifacts/firefox/promnesia-<version>.zip .
51
48
  #+end_src
52
49
 
53
50
  This will copy it into the current directory on the HOST system.
@@ -10,7 +10,6 @@ npm install
10
10
 
11
11
  FAILED=0
12
12
 
13
- npm run flow || FAILED=1
14
13
  npm run eslint || FAILED=1
15
14
  npm run test || FAILED=1
16
15
 
@@ -0,0 +1,30 @@
1
+ // this is to prevent tests failing on importing browser polyfill
2
+ // see https://stackoverflow.com/questions/73809020/cant-mock-webextension-polyfill-for-jest-unit-tests
3
+ import { jest } from "@jest/globals"
4
+
5
+ const mockBrowser = {
6
+ history: {
7
+ getVisits: jest.fn(),
8
+ search : jest.fn(),
9
+ },
10
+ bookmarks: {
11
+ getTree: jest.fn(),
12
+ },
13
+ storage: {
14
+ sync: {
15
+ // meh.
16
+ get: (name, res) => {
17
+ res({'options': {
18
+ host: 'http://badhost:43210', // some random port, to cause it fail
19
+ }})
20
+ }
21
+ },
22
+ },
23
+ runtime: {
24
+ lastError: null,
25
+ getManifest : () => { return {version: 'whatever'} },
26
+ getPlatformInfo: async () => {},
27
+ },
28
+ }
29
+
30
+ export default mockBrowser
@@ -0,0 +1,47 @@
1
+ {
2
+ "version": {
3
+ "approval_notes": "
4
+ You can find up-to-date extension code here https://github.com/karlicoss/promnesia/tree/master/extension
5
+
6
+ The build instructions assume that the zip file with source code is in =/path/to/promnesia-source.zip= (on the HOST system).
7
+ *Make sure to replace it with the actual path to the source code zip file.*
8
+
9
+ To build you need *Ubuntu 24.04/Noble* and *Node 20*. The easiest way to build cleanly would be a Docker container:
10
+
11
+ ```
12
+ # on the HOST system: cleanup previous container -- if it didn't exist in the first, it will show an error, ignore it
13
+ docker rm -f promnesia_build
14
+
15
+ # on the HOST system: create the container
16
+ docker create --name promnesia_build -it ubuntu:noble /bin/bash
17
+
18
+ # on the HOST system: put the sources into the container
19
+ docker cp /path/to/promnesia-source.zip promnesia_build:/promnesia.zip
20
+
21
+ # on the HOST system: start the container
22
+ docker start -i promnesia_build
23
+ ```
24
+
25
+ After that build the addon (run these commands INSIDE the container if you choose to do it with Docker):
26
+
27
+ ```
28
+ $ apt update && apt install -y git curl unzip
29
+ $ curl -fsSL https://deb.nodesource.com/setup_20.x | bash -
30
+ $ DEBIAN_FRONTEND=noninteractive apt install -y nodejs
31
+ $ unzip promnesia.zip -d promnesia
32
+ $ cd promnesia
33
+ $ npm install
34
+ $ ./build --firefox --release --lint --publish=skip
35
+ ```
36
+
37
+
38
+ The final artifact will be in =/promnesia/dist/artifacts/firefox/promnesia-<version>.zip= (INSIDE the container).
39
+
40
+ If you need to get it back onto the HOST system (e.g. to test in the browser), run on the HOST system (e.g. in a separate terminal):
41
+
42
+ docker cp promnesia_build:/promnesia/dist/artifacts/firefox/promnesia-<version>.zip .
43
+
44
+ This will copy it into the current directory on the HOST system.
45
+ "
46
+ }
47
+ }
@@ -1,11 +1,12 @@
1
1
  const presets = [
2
- '@babel/preset-flow',
3
-
4
2
  // this is necessary for jest? otherwsie it can't import modules..
5
3
  // ugh... I don't understand tbh, seems that even without preset-env, webpack respects browserlist??
6
4
  // and looks like without preset-env the code is cleaner???
7
5
  // but whatever, the difference is minor and I don't have energy to investigate now..
8
6
  '@babel/preset-env',
7
+
8
+ // also necessary for jest? otherwise fails to import typescript
9
+ '@babel/preset-typescript',
9
10
  ]
10
11
  const plugins = []
11
12