{"id":41390665,"url":"https://github.com/tuturto/archimedes","last_synced_at":"2026-01-23T12:33:53.565Z","repository":{"id":62575810,"uuid":"51772168","full_name":"tuturto/archimedes","owner":"tuturto","description":"Hy macros for Hypothesis framework","archived":false,"fork":false,"pushed_at":"2023-08-23T16:02:26.000Z","size":36,"stargazers_count":14,"open_issues_count":3,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-07T16:58:19.675Z","etag":null,"topics":["hy","macros","testing"],"latest_commit_sha":null,"homepage":null,"language":"Hy","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tuturto.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"license.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-02-15T17:22:29.000Z","updated_at":"2025-04-05T03:29:37.000Z","dependencies_parsed_at":"2022-11-03T19:00:07.392Z","dependency_job_id":null,"html_url":"https://github.com/tuturto/archimedes","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/tuturto/archimedes","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tuturto%2Farchimedes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tuturto%2Farchimedes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tuturto%2Farchimedes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tuturto%2Farchimedes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tuturto","download_url":"https://codeload.github.com/tuturto/archimedes/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tuturto%2Farchimedes/sbom","scorecard":{"id":903085,"data":{"date":"2025-08-11","repo":{"name":"github.com/tuturto/archimedes","commit":"56f63821feb7309f37c076172d8725ba7a0794d1"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.9,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":9,"reason":"binaries present in source code","details":["Warn: binary detected: src/tests/__init__.pyc:1"],"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: license.txt:0","Info: FSF or OSI recognized license: MIT License: license.txt:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-24T16:23:25.354Z","repository_id":62575810,"created_at":"2025-08-24T16:23:25.354Z","updated_at":"2025-08-24T16:23:25.354Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28691758,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-23T11:01:27.039Z","status":"ssl_error","status_checked_at":"2026-01-23T11:00:26.909Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hy","macros","testing"],"created_at":"2026-01-23T12:33:53.484Z","updated_at":"2026-01-23T12:33:53.552Z","avatar_url":"https://github.com/tuturto.png","language":"Hy","funding_links":[],"categories":[],"sub_categories":[],"readme":"Hy macros for Hypothesis framework\n==================================\n\nArchimedes is a set of Hy macros that are used to make writing tests with\nHypothesis easier. ``fact`` specifies a test case, ``variants`` and\n``sample`` specify rules for test data generation, ``profile`` specifies\ntest settings, ``background`` and ``with-background`` specify common data\nbetween tests. ``assert-macro-error`` checks that ``macro-error`` is\ncalled with given message during macro expansion. For regular errors and\nexceptions, use ``assert-error``.\n\nIn case you're using PyHamcrest, there's two macros to help you define\nmatchers: ``defmatcher`` and ``attribute-matcher``. And for Hymn, there\nis ``assert-right``.\n\nFor interactive mode, it's sometimes easier to execute ``fact``\nimmediately. For this case, use ``check``.\n\nOnly Hypothesis is installed as a dependency. Hamcrest and Hymn have to\nbe installed separately.\n\nFor more comprehensive documentation, see http://archimedes.readthedocs.io/\n\nAlso, Archimedes_ was a Greek mathematician, physicist, engineer, inventor\nand astronomer.\n\nExamples are good:\n------------------\n\n.. code-block:: hy\n\n   (require [archimedes [background fact check defmatcher attribute-matcher \n                         assert-macro-error assert-error assert-right\n                         with-background]])\n   \n   (import [hypothesis.strategies [integers]]\n           [hamcrest [assert-that]]\n           [math [pow]])\n\n   (fact \"true is always true\"\n         (assert True))\n\n   (background some-numbers\n         a 3\n         b 4\n         c 5)\n\n   (fact \"Pythagorean theorem holds in this specific case\"\n         (with-background some-numbers [a b c]\n           (assert (= (+ (pow a 2) (pow b 2)) (pow c 2)))))\n\n   (fact \"sum of two positive numbers is larger than either one of them\"\n         (variants :a (integers :min-value 1)\n                   :b (integers :min-value 1))\n         (assert (\u003e (+ a b) a))\n         (assert (\u003e (+ a b) b)))\n\n   (fact \"example can clarify things\"\n         (variants :a (integers :min-value 0 :max-value 10)\n                   :b (integers :min-value 0 :max-value 10))\n         (sample :a 0 :b 0)\n         (assert (\u003c= 0 (+ a b) 20)))\n\n   (fact \"profile controls test settings\"\n         (variants :a (integers :min-value 0))\n         (profile :max-examples 500)\n         (assert (\u003c= 0 a)))\n\n   (fact \"macro errors can be asserted\"\n         (assert-macro-error \"cond branches need to be a list\"\n                             (cond (= 1 1) True)))\n\n   (fact \"even fact can be asserted for macro errors\"\n         (assert-macro-error \"too many variants forms\"\n                             (fact \"I'm incorrect\"\n                                   (variants :a (integers))\n                                   (variants :a (integers))\n                                   (assert (= a a)))))\n\n   (fact \"errors can be asserted\"\n         (assert-error \"error\"\n                       (raise (ValueError \"error\"))))\n\n   (check \"this is executed immediately\"\n          (assert (= 1 1)))\n\n   (defmatcher is-zero? []\n               :match? (= item 0)\n               :match! \"a zero\"\n               :no-match! (.format \"was a value of {0}\" item))\n\n   (assert-that 0 (is-zero?))\n\n   (attribute-matcher item-with-length?\n                      len =\n                      \"an item with length {0}\"\n                      \"was an item with length {0}\")\n\n   (assert-that \"foo\" (is- (item-with-length? 3)))\n\nDetails are needed sometimes:\n-----------------------------\n\n``(background name elements)`` defines setup function. Name is symbol. Name\nof the test function will be ``\"setup_\" + name``. ``elements`` is a list\nof alternating symbols and their values. The setup function will return a \ndictionary with keywordified symbols as keys and corresponding values as \ntheir values.\n\n``(fact description code)`` specifies a test function. ``description`` is a\nstring describing what the test is about. The generated function will have a\nname ``\"test_\" + description`` and no arguments. Docstring of the function\nwill be value of ``description``. ``code`` can be one or more forms of code,\nthey are inserted inside of the test function as is.\n\n``(check description code)`` works just like ``fact``, except that the\nresulting test function is immediately executed. This is useful when working\nin interactive envinroment, like Jupyter or Hy repl.\n\n``(with-background name symbols code)`` generates a let binding with code to call\nbackground specified by ``name``. ``symbols`` is list of symbols that should\nbe retrieved from dictionary returned by setup function and bound to local\ncontext. ``code`` is one or more elements of code, used to test things.\n\n``(variants keyword specification)`` is used to specify test data that should\nbe generated by Hypothesis. It accepts arbitrary, but even, amount of\nparameters. First specifies keywordified symbol and second strategy used to\ngenerate value. If this form is present, test function's parameter list is\nmodified to have named parameters specified by keywords and is also wrapped\nin ``given`` decorator.\n\n``(sample keyword value)`` specifies sample set of values. Keyword specifies\nsymbol and value holds the value bound to it. It should have same amount of\nkeywords as ``variants`` form and can't be used without ``variants`` form.\n\n``(profile keyword value)`` specifies test settings. They match directly to\nparameters given to ``settings`` decorator.\n\n``(assert-macro-error message code)`` asserts that during macro expansion of\n``code`` an error is raised with a message of ``message``.\n\n``(assert-error message code)`` asserts that code raises an error, which\nstring representation is equal to message.\n\n``(def-matcher name parameters :match? code :match! string :no-match string)``\nis used to create matcher function for hamcrest library. The resulting\nmatcher can then be used in assertions. Since the macro creates a behind the\nscenes class, all parameters passed to it are accessible as instance\nattributes. In ``match?``, ``match!`` and ``no-match!`` blocks, symbol\n``item`` is bound to item currently under comparison.\n\n.. code-block::\n\n   (defmatcher length-of? [value]\n               :match? (= (len item) self.value)\n               :match! (.format \"an item with length of {0} \n                                self.value)\n               :no-match (.format \"was an item with length of {0}\"\n                                  (len item)))\n\n   (assert-that value (is- (lenght-of? 5)))\n\n``(attribute-matcher name function predicate string string)`` is a special\ncase for matcher, where function is used to check a value of some matched\nitem and then compared to given value using predicate. Thus, the previous\nexample can be written as:\n\n.. code-block::\n\n   (attribute-matcher length-of?\n                      len =\n                      \"an item with length of {0}\"\n                      \"was an item with length of {0}\")\n\n   (assert-that value (is- (length-of? 5)))\n\n``assert-right`` is used with Hymn library's ``Either`` monad. It first\nchecks that ``right`` was returned as a result of computation and then\nproceeds to run assertion block:\n\n.. code-block::\n\n   (assert-right (do-monad [status (advance-time-m society)]\n                            status)\n                 (assert-that society\n                              (has-less-resources-than? old-resources)))\n\n\nNote about test framework:\n--------------------------\n\nArchimedes is geared towards Nose, but it might work with other frameworks\nthat rely on naming conventions to discover tests to be executed.\n\nLicense:\n--------\n\nLicensed under MIT license\n\n.. _Archimedes: https://en.wikipedia.org/wiki/Archimedes\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftuturto%2Farchimedes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftuturto%2Farchimedes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftuturto%2Farchimedes/lists"}