From 4c141a69cd6fb602515768d4ceadd1f5c91722e4 Mon Sep 17 00:00:00 2001 From: Alexandre Teles Date: Mon, 10 Apr 2023 20:43:24 -0300 Subject: [PATCH 01/30] feat: add poetry project support --- poetry.lock | 181 +++++++++++++++++++++++++++++++++++++++++++++++ pyproject.toml | 18 +++++ requirements.txt | 5 ++ 3 files changed, 204 insertions(+) create mode 100644 poetry.lock create mode 100644 pyproject.toml create mode 100644 requirements.txt diff --git a/poetry.lock b/poetry.lock new file mode 100644 index 0000000..fcdfb76 --- /dev/null +++ b/poetry.lock @@ -0,0 +1,181 @@ +# This file is automatically @generated by Poetry and should not be changed by hand. + +[[package]] +name = "certifi" +version = "2022.12.7" +description = "Python package for providing Mozilla's CA Bundle." +category = "main" +optional = false +python-versions = ">=3.6" +files = [ + {file = "certifi-2022.12.7-py3-none-any.whl", hash = "sha256:4ad3232f5e926d6718ec31cfc1fcadfde020920e278684144551c91769c7bc18"}, + {file = "certifi-2022.12.7.tar.gz", hash = "sha256:35824b4c3a97115964b408844d64aa14db1cc518f6562e8d7261699d1350a9e3"}, +] + +[[package]] +name = "charset-normalizer" +version = "3.1.0" +description = "The Real First Universal Charset Detector. Open, modern and actively maintained alternative to Chardet." +category = "main" +optional = false +python-versions = ">=3.7.0" +files = [ + {file = "charset-normalizer-3.1.0.tar.gz", hash = "sha256:34e0a2f9c370eb95597aae63bf85eb5e96826d81e3dcf88b8886012906f509b5"}, + {file = "charset_normalizer-3.1.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:e0ac8959c929593fee38da1c2b64ee9778733cdf03c482c9ff1d508b6b593b2b"}, + {file = "charset_normalizer-3.1.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:d7fc3fca01da18fbabe4625d64bb612b533533ed10045a2ac3dd194bfa656b60"}, + {file = "charset_normalizer-3.1.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:04eefcee095f58eaabe6dc3cc2262f3bcd776d2c67005880894f447b3f2cb9c1"}, + {file = "charset_normalizer-3.1.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:20064ead0717cf9a73a6d1e779b23d149b53daf971169289ed2ed43a71e8d3b0"}, + {file = "charset_normalizer-3.1.0-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1435ae15108b1cb6fffbcea2af3d468683b7afed0169ad718451f8db5d1aff6f"}, + {file = "charset_normalizer-3.1.0-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:c84132a54c750fda57729d1e2599bb598f5fa0344085dbde5003ba429a4798c0"}, + {file = "charset_normalizer-3.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:75f2568b4189dda1c567339b48cba4ac7384accb9c2a7ed655cd86b04055c795"}, + {file = "charset_normalizer-3.1.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:11d3bcb7be35e7b1bba2c23beedac81ee893ac9871d0ba79effc7fc01167db6c"}, + {file = "charset_normalizer-3.1.0-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:891cf9b48776b5c61c700b55a598621fdb7b1e301a550365571e9624f270c203"}, + {file = "charset_normalizer-3.1.0-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:5f008525e02908b20e04707a4f704cd286d94718f48bb33edddc7d7b584dddc1"}, + {file = "charset_normalizer-3.1.0-cp310-cp310-musllinux_1_1_ppc64le.whl", hash = "sha256:b06f0d3bf045158d2fb8837c5785fe9ff9b8c93358be64461a1089f5da983137"}, + {file = "charset_normalizer-3.1.0-cp310-cp310-musllinux_1_1_s390x.whl", hash = "sha256:49919f8400b5e49e961f320c735388ee686a62327e773fa5b3ce6721f7e785ce"}, + {file = "charset_normalizer-3.1.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:22908891a380d50738e1f978667536f6c6b526a2064156203d418f4856d6e86a"}, + {file = "charset_normalizer-3.1.0-cp310-cp310-win32.whl", hash = "sha256:12d1a39aa6b8c6f6248bb54550efcc1c38ce0d8096a146638fd4738e42284448"}, + {file = "charset_normalizer-3.1.0-cp310-cp310-win_amd64.whl", hash = "sha256:65ed923f84a6844de5fd29726b888e58c62820e0769b76565480e1fdc3d062f8"}, + {file = "charset_normalizer-3.1.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:9a3267620866c9d17b959a84dd0bd2d45719b817245e49371ead79ed4f710d19"}, + {file = "charset_normalizer-3.1.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:6734e606355834f13445b6adc38b53c0fd45f1a56a9ba06c2058f86893ae8017"}, + {file = "charset_normalizer-3.1.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:f8303414c7b03f794347ad062c0516cee0e15f7a612abd0ce1e25caf6ceb47df"}, + {file = "charset_normalizer-3.1.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:aaf53a6cebad0eae578f062c7d462155eada9c172bd8c4d250b8c1d8eb7f916a"}, + {file = "charset_normalizer-3.1.0-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:3dc5b6a8ecfdc5748a7e429782598e4f17ef378e3e272eeb1340ea57c9109f41"}, + {file = "charset_normalizer-3.1.0-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:e1b25e3ad6c909f398df8921780d6a3d120d8c09466720226fc621605b6f92b1"}, + {file = "charset_normalizer-3.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0ca564606d2caafb0abe6d1b5311c2649e8071eb241b2d64e75a0d0065107e62"}, + {file = "charset_normalizer-3.1.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b82fab78e0b1329e183a65260581de4375f619167478dddab510c6c6fb04d9b6"}, + {file = "charset_normalizer-3.1.0-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:bd7163182133c0c7701b25e604cf1611c0d87712e56e88e7ee5d72deab3e76b5"}, + {file = "charset_normalizer-3.1.0-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:11d117e6c63e8f495412d37e7dc2e2fff09c34b2d09dbe2bee3c6229577818be"}, + {file = "charset_normalizer-3.1.0-cp311-cp311-musllinux_1_1_ppc64le.whl", hash = "sha256:cf6511efa4801b9b38dc5546d7547d5b5c6ef4b081c60b23e4d941d0eba9cbeb"}, + {file = "charset_normalizer-3.1.0-cp311-cp311-musllinux_1_1_s390x.whl", hash = "sha256:abc1185d79f47c0a7aaf7e2412a0eb2c03b724581139193d2d82b3ad8cbb00ac"}, + {file = "charset_normalizer-3.1.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:cb7b2ab0188829593b9de646545175547a70d9a6e2b63bf2cd87a0a391599324"}, + {file = "charset_normalizer-3.1.0-cp311-cp311-win32.whl", hash = "sha256:c36bcbc0d5174a80d6cccf43a0ecaca44e81d25be4b7f90f0ed7bcfbb5a00909"}, + {file = "charset_normalizer-3.1.0-cp311-cp311-win_amd64.whl", hash = "sha256:cca4def576f47a09a943666b8f829606bcb17e2bc2d5911a46c8f8da45f56755"}, + {file = "charset_normalizer-3.1.0-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:0c95f12b74681e9ae127728f7e5409cbbef9cd914d5896ef238cc779b8152373"}, + {file = "charset_normalizer-3.1.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:fca62a8301b605b954ad2e9c3666f9d97f63872aa4efcae5492baca2056b74ab"}, + {file = "charset_normalizer-3.1.0-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ac0aa6cd53ab9a31d397f8303f92c42f534693528fafbdb997c82bae6e477ad9"}, + {file = "charset_normalizer-3.1.0-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:c3af8e0f07399d3176b179f2e2634c3ce9c1301379a6b8c9c9aeecd481da494f"}, + {file = "charset_normalizer-3.1.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3a5fc78f9e3f501a1614a98f7c54d3969f3ad9bba8ba3d9b438c3bc5d047dd28"}, + {file = "charset_normalizer-3.1.0-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:628c985afb2c7d27a4800bfb609e03985aaecb42f955049957814e0491d4006d"}, + {file = "charset_normalizer-3.1.0-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:74db0052d985cf37fa111828d0dd230776ac99c740e1a758ad99094be4f1803d"}, + {file = "charset_normalizer-3.1.0-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:1e8fcdd8f672a1c4fc8d0bd3a2b576b152d2a349782d1eb0f6b8e52e9954731d"}, + {file = "charset_normalizer-3.1.0-cp37-cp37m-musllinux_1_1_ppc64le.whl", hash = "sha256:04afa6387e2b282cf78ff3dbce20f0cc071c12dc8f685bd40960cc68644cfea6"}, + {file = "charset_normalizer-3.1.0-cp37-cp37m-musllinux_1_1_s390x.whl", hash = "sha256:dd5653e67b149503c68c4018bf07e42eeed6b4e956b24c00ccdf93ac79cdff84"}, + {file = "charset_normalizer-3.1.0-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:d2686f91611f9e17f4548dbf050e75b079bbc2a82be565832bc8ea9047b61c8c"}, + {file = "charset_normalizer-3.1.0-cp37-cp37m-win32.whl", hash = "sha256:4155b51ae05ed47199dc5b2a4e62abccb274cee6b01da5b895099b61b1982974"}, + {file = "charset_normalizer-3.1.0-cp37-cp37m-win_amd64.whl", hash = "sha256:322102cdf1ab682ecc7d9b1c5eed4ec59657a65e1c146a0da342b78f4112db23"}, + {file = "charset_normalizer-3.1.0-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:e633940f28c1e913615fd624fcdd72fdba807bf53ea6925d6a588e84e1151531"}, + {file = "charset_normalizer-3.1.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:3a06f32c9634a8705f4ca9946d667609f52cf130d5548881401f1eb2c39b1e2c"}, + {file = "charset_normalizer-3.1.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:7381c66e0561c5757ffe616af869b916c8b4e42b367ab29fedc98481d1e74e14"}, + {file = "charset_normalizer-3.1.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3573d376454d956553c356df45bb824262c397c6e26ce43e8203c4c540ee0acb"}, + {file = "charset_normalizer-3.1.0-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e89df2958e5159b811af9ff0f92614dabf4ff617c03a4c1c6ff53bf1c399e0e1"}, + {file = "charset_normalizer-3.1.0-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:78cacd03e79d009d95635e7d6ff12c21eb89b894c354bd2b2ed0b4763373693b"}, + {file = "charset_normalizer-3.1.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:de5695a6f1d8340b12a5d6d4484290ee74d61e467c39ff03b39e30df62cf83a0"}, + {file = "charset_normalizer-3.1.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1c60b9c202d00052183c9be85e5eaf18a4ada0a47d188a83c8f5c5b23252f649"}, + {file = "charset_normalizer-3.1.0-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:f645caaf0008bacf349875a974220f1f1da349c5dbe7c4ec93048cdc785a3326"}, + {file = "charset_normalizer-3.1.0-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:ea9f9c6034ea2d93d9147818f17c2a0860d41b71c38b9ce4d55f21b6f9165a11"}, + {file = "charset_normalizer-3.1.0-cp38-cp38-musllinux_1_1_ppc64le.whl", hash = "sha256:80d1543d58bd3d6c271b66abf454d437a438dff01c3e62fdbcd68f2a11310d4b"}, + {file = "charset_normalizer-3.1.0-cp38-cp38-musllinux_1_1_s390x.whl", hash = "sha256:73dc03a6a7e30b7edc5b01b601e53e7fc924b04e1835e8e407c12c037e81adbd"}, + {file = "charset_normalizer-3.1.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:6f5c2e7bc8a4bf7c426599765b1bd33217ec84023033672c1e9a8b35eaeaaaf8"}, + {file = "charset_normalizer-3.1.0-cp38-cp38-win32.whl", hash = "sha256:12a2b561af122e3d94cdb97fe6fb2bb2b82cef0cdca131646fdb940a1eda04f0"}, + {file = "charset_normalizer-3.1.0-cp38-cp38-win_amd64.whl", hash = "sha256:3160a0fd9754aab7d47f95a6b63ab355388d890163eb03b2d2b87ab0a30cfa59"}, + {file = "charset_normalizer-3.1.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:38e812a197bf8e71a59fe55b757a84c1f946d0ac114acafaafaf21667a7e169e"}, + {file = "charset_normalizer-3.1.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:6baf0baf0d5d265fa7944feb9f7451cc316bfe30e8df1a61b1bb08577c554f31"}, + {file = "charset_normalizer-3.1.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:8f25e17ab3039b05f762b0a55ae0b3632b2e073d9c8fc88e89aca31a6198e88f"}, + {file = "charset_normalizer-3.1.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3747443b6a904001473370d7810aa19c3a180ccd52a7157aacc264a5ac79265e"}, + {file = "charset_normalizer-3.1.0-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:b116502087ce8a6b7a5f1814568ccbd0e9f6cfd99948aa59b0e241dc57cf739f"}, + {file = "charset_normalizer-3.1.0-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:d16fd5252f883eb074ca55cb622bc0bee49b979ae4e8639fff6ca3ff44f9f854"}, + {file = "charset_normalizer-3.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:21fa558996782fc226b529fdd2ed7866c2c6ec91cee82735c98a197fae39f706"}, + {file = "charset_normalizer-3.1.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:6f6c7a8a57e9405cad7485f4c9d3172ae486cfef1344b5ddd8e5239582d7355e"}, + {file = "charset_normalizer-3.1.0-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:ac3775e3311661d4adace3697a52ac0bab17edd166087d493b52d4f4f553f9f0"}, + {file = "charset_normalizer-3.1.0-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:10c93628d7497c81686e8e5e557aafa78f230cd9e77dd0c40032ef90c18f2230"}, + {file = "charset_normalizer-3.1.0-cp39-cp39-musllinux_1_1_ppc64le.whl", hash = "sha256:6f4f4668e1831850ebcc2fd0b1cd11721947b6dc7c00bf1c6bd3c929ae14f2c7"}, + {file = "charset_normalizer-3.1.0-cp39-cp39-musllinux_1_1_s390x.whl", hash = "sha256:0be65ccf618c1e7ac9b849c315cc2e8a8751d9cfdaa43027d4f6624bd587ab7e"}, + {file = "charset_normalizer-3.1.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:53d0a3fa5f8af98a1e261de6a3943ca631c526635eb5817a87a59d9a57ebf48f"}, + {file = "charset_normalizer-3.1.0-cp39-cp39-win32.whl", hash = "sha256:a04f86f41a8916fe45ac5024ec477f41f886b3c435da2d4e3d2709b22ab02af1"}, + {file = "charset_normalizer-3.1.0-cp39-cp39-win_amd64.whl", hash = "sha256:830d2948a5ec37c386d3170c483063798d7879037492540f10a475e3fd6f244b"}, + {file = "charset_normalizer-3.1.0-py3-none-any.whl", hash = "sha256:3d9098b479e78c85080c98e1e35ff40b4a31d8953102bb0fd7d1b6f8a2111a3d"}, +] + +[[package]] +name = "idna" +version = "3.4" +description = "Internationalized Domain Names in Applications (IDNA)" +category = "main" +optional = false +python-versions = ">=3.5" +files = [ + {file = "idna-3.4-py3-none-any.whl", hash = "sha256:90b77e79eaa3eba6de819a0c442c0b4ceefc341a7a2ab77d7562bf49f425c5c2"}, + {file = "idna-3.4.tar.gz", hash = "sha256:814f528e8dead7d329833b91c5faa87d60bf71824cd12a7530b5526063d02cb4"}, +] + +[[package]] +name = "requests" +version = "2.28.2" +description = "Python HTTP for Humans." +category = "main" +optional = false +python-versions = ">=3.7, <4" +files = [ + {file = "requests-2.28.2-py3-none-any.whl", hash = "sha256:64299f4909223da747622c030b781c0d7811e359c37124b4bd368fb8c6518baa"}, + {file = "requests-2.28.2.tar.gz", hash = "sha256:98b1b2782e3c6c4904938b84c0eb932721069dfdb9134313beff7c83c2df24bf"}, +] + +[package.dependencies] +certifi = ">=2017.4.17" +charset-normalizer = ">=2,<4" +idna = ">=2.5,<4" +urllib3 = ">=1.21.1,<1.27" + +[package.extras] +socks = ["PySocks (>=1.5.6,!=1.5.7)"] +use-chardet-on-py3 = ["chardet (>=3.0.2,<6)"] + +[[package]] +name = "types-requests" +version = "2.28.11.17" +description = "Typing stubs for requests" +category = "dev" +optional = false +python-versions = "*" +files = [ + {file = "types-requests-2.28.11.17.tar.gz", hash = "sha256:0d580652ce903f643f8c3b494dd01d29367ea57cea0c7ad7f65cf3169092edb0"}, + {file = "types_requests-2.28.11.17-py3-none-any.whl", hash = "sha256:cc1aba862575019306b2ed134eb1ea994cab1c887a22e18d3383e6dd42e9789b"}, +] + +[package.dependencies] +types-urllib3 = "<1.27" + +[[package]] +name = "types-urllib3" +version = "1.26.25.10" +description = "Typing stubs for urllib3" +category = "dev" +optional = false +python-versions = "*" +files = [ + {file = "types-urllib3-1.26.25.10.tar.gz", hash = "sha256:c44881cde9fc8256d05ad6b21f50c4681eb20092552351570ab0a8a0653286d6"}, + {file = "types_urllib3-1.26.25.10-py3-none-any.whl", hash = "sha256:12c744609d588340a07e45d333bf870069fc8793bcf96bae7a96d4712a42591d"}, +] + +[[package]] +name = "urllib3" +version = "1.26.15" +description = "HTTP library with thread-safe connection pooling, file post, and more." +category = "main" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*" +files = [ + {file = "urllib3-1.26.15-py2.py3-none-any.whl", hash = "sha256:aa751d169e23c7479ce47a0cb0da579e3ede798f994f5816a74e4f4500dcea42"}, + {file = "urllib3-1.26.15.tar.gz", hash = "sha256:8a388717b9476f934a21484e8c8e61875ab60644d29b9b39e11e4b9dc1c6b305"}, +] + +[package.extras] +brotli = ["brotli (>=1.0.9)", "brotlicffi (>=0.8.0)", "brotlipy (>=0.6.0)"] +secure = ["certifi", "cryptography (>=1.3.4)", "idna (>=2.0.0)", "ipaddress", "pyOpenSSL (>=0.14)", "urllib3-secure-extra"] +socks = ["PySocks (>=1.5.6,!=1.5.7,<2.0)"] + +[metadata] +lock-version = "2.0" +python-versions = "^3.11" +content-hash = "747d86bc4792bf2d1f4713f4ee23731066fd73ef95c3bb6a15bbdce896232193" diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..d8f4e5e --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,18 @@ +[tool.poetry] +name = "revanced-static-api" +version = "0.0.1" +description = "Static API for ReVanced" +authors = ["Alexandre Teles ", "oSumAtrIX "] +license = "GPLv3" +readme = "README.md" + +[tool.poetry.dependencies] +python = "^3.11" +requests = "^2.28.2" + +[tool.poetry.group.dev.dependencies] +types-requests = "^2.28.11.17" + +[build-system] +requires = ["poetry-core"] +build-backend = "poetry.core.masonry.api" diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..a87fa7d --- /dev/null +++ b/requirements.txt @@ -0,0 +1,5 @@ +certifi==2022.12.7 ; python_version >= "3.11" and python_version < "4" +charset-normalizer==3.1.0 ; python_version >= "3.11" and python_version < "4" +idna==3.4 ; python_version >= "3.11" and python_version < "4" +requests==2.28.2 ; python_version >= "3.11" and python_version < "4" +urllib3==1.26.15 ; python_version >= "3.11" and python_version < "4" From 07dc65e1eeb05ad04612a52b326596e34a289854 Mon Sep 17 00:00:00 2001 From: Alexandre Teles Date: Mon, 10 Apr 2023 20:44:14 -0300 Subject: [PATCH 02/30] chore: bump python version --- .github/workflows/update.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update.yml b/.github/workflows/update.yml index c1ea231..d698a70 100644 --- a/.github/workflows/update.yml +++ b/.github/workflows/update.yml @@ -17,7 +17,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v2 with: - python-version: 3.10.10 + python-version: 3.11.3 - name: Create configuration file run: echo "${{ vars.CONFIG }}" > config.json From 1beb377b4b1a412558f3eb517d939550463ccd22 Mon Sep 17 00:00:00 2001 From: Alexandre Teles Date: Mon, 10 Apr 2023 20:45:02 -0300 Subject: [PATCH 03/30] refactor: black formatting --- src/app/api.py | 171 ++++++++++++++++++++++++------------------- src/app/config.py | 5 +- src/app/generator.py | 166 +++++++++++++++++++++-------------------- src/app/utils.py | 26 ++++--- src/main.py | 17 +++-- 5 files changed, 207 insertions(+), 178 deletions(-) diff --git a/src/app/api.py b/src/app/api.py index 9a61595..7abcfa2 100644 --- a/src/app/api.py +++ b/src/app/api.py @@ -2,96 +2,113 @@ from abc import abstractmethod import requests -class Api(): - _api_key: str - - @abstractmethod - def __init__(self, api_key: str = None) -> None: - self._api_key: str = api_key - - @abstractmethod - def get_release(self, repository: str, all: bool = False, prerelease: bool = False) -> dict | list: - '''Gets the release(s) for a repository. - Args: - repository (str): The repository to get releases for. - all (bool, optional): Whether to get all releases or not. Defaults to False. - prerelease (bool, optional): Whether to get prereleases or not. Defaults to False. - Returns: - dict | list: The release(s) for the repository. - ''' - raise NotImplementedError - - @abstractmethod - def get_contributor(self, repository): - '''Gets the contributors for a repository. +class Api: + _api_key: str + + @abstractmethod + def __init__(self, api_key: str = None) -> None: + self._api_key: str = api_key + + @abstractmethod + def get_release( + self, repository: str, all: bool = False, prerelease: bool = False + ) -> dict | list: + """Gets the release(s) for a repository. + + Args: + repository (str): The repository to get releases for. + all (bool, optional): Whether to get all releases or not. Defaults to False. + prerelease (bool, optional): Whether to get prereleases or not. Defaults to False. + Returns: + dict | list: The release(s) for the repository. + """ + raise NotImplementedError + + @abstractmethod + def get_contributor(self, repository): + """Gets the contributors for a repository. + + Args: + repository (str): The repository to get contributors for. + """ + raise NotImplementedError - Args: - repository (str): The repository to get contributors for. - ''' - raise NotImplementedError class GitHubApi(Api): - def __init__(self) -> None: - pass + def __init__(self) -> None: + pass - def get_contributor(self, repository): - def transform_contributor(contributor: dict) -> dict: - '''Transforms a contributor into a dict. + def get_contributor(self, repository): + def transform_contributor(contributor: dict) -> dict: + """Transforms a contributor into a dict. - Args: - contributor (dict): The contributor to transform. + Args: + contributor (dict): The contributor to transform. - Returns: - dict: The transformed contributor. - ''' + Returns: + dict: The transformed contributor. + """ - return { - 'username': contributor['login'], - 'avatar': contributor['avatar_url'], # TODO: Proxy via a CDN. - 'link': contributor['html_url'], - 'contributions': contributor['contributions'] - } + return { + "username": contributor["login"], + "avatar": contributor["avatar_url"], # TODO: Proxy via a CDN. + "link": contributor["html_url"], + "contributions": contributor["contributions"], + } - def sort_and_delete_key(contributor: dict) -> int: - contributions = contributor['contributions'] - del contributor['contributions'] - return contributions + def sort_and_delete_key(contributor: dict) -> int: + contributions = contributor["contributions"] + del contributor["contributions"] + return contributions - contributors = requests.get(f'https://api.github.com/repos/{repository}/contributors').json() - contributors = list(map(transform_contributor, contributors)) # List might not be needed. - contributors.sort(key=sort_and_delete_key, reverse=True) + contributors = requests.get( + f"https://api.github.com/repos/{repository}/contributors" + ).json() + contributors = list( + map(transform_contributor, contributors) + ) # List might not be needed. + contributors.sort(key=sort_and_delete_key, reverse=True) - return contributors + return contributors - def get_release(self, repository: str, all: bool = False, prerelease: bool = False) -> dict | list: - def transform_release(release: dict) -> dict: - '''Transforms a release dict into a dict. + def get_release( + self, repository: str, all: bool = False, prerelease: bool = False + ) -> dict | list: + def transform_release(release: dict) -> dict: + """Transforms a release dict into a dict. - Args: - release (dict): The release dict to transform. + Args: + release (dict): The release dict to transform. - Returns: - dict: The transformed release dict. - ''' + Returns: + dict: The transformed release dict. + """ - return { - # TODO: Check if theres any need for this: 'id': release['id']. - 'tag': release['tag_name'], - 'prerelease': release['prerelease'], - 'published_at': release['published_at'], - 'assets': [ - { - 'name': asset['name'], - 'download_url': asset['browser_download_url'] # TODO: Proxy via a CDN. - } for asset in release['assets'] - ] - } + return { + # TODO: Check if theres any need for this: 'id': release['id']. + "tag": release["tag_name"], + "prerelease": release["prerelease"], + "published_at": release["published_at"], + "assets": [ + { + "name": asset["name"], + "download_url": asset[ + "browser_download_url" + ], # TODO: Proxy via a CDN. + } + for asset in release["assets"] + ], + } - # A little bit of code duplication but more readable than a ternary operation. - if all: - releases: list = requests.get(f'https://api.github.com/repos/{repository}/releases').json() - return list(map(transform_release, releases)) # List might not be needed. - else: - latest_release: object = requests.get(f'https://api.github.com/repos/{repository}/releases/latest?prerelease={prerelease}').json() - return transform_release(latest_release) + # A little bit of code duplication but more readable than a ternary operation. + if all: + releases: list = requests.get( + f"https://api.github.com/repos/{repository}/releases" + ).json() + return list(map(transform_release, releases)) # List might not be needed. + else: + latest_release: object = requests.get( + f"https://api.github.com/repos/{repository}/releases/latest?prerelease={prerelease}" + ).json() + return transform_release(latest_release) diff --git a/src/app/config.py b/src/app/config.py index 7256ee4..45b3e3e 100644 --- a/src/app/config.py +++ b/src/app/config.py @@ -1,5 +1,6 @@ import json + def load_config() -> dict: - with open('config.json', 'r') as config_file: - return json.load(config_file) + with open("config.json", "r") as config_file: + return json.load(config_file) diff --git a/src/app/generator.py b/src/app/generator.py index 9d20905..e3dfd8c 100644 --- a/src/app/generator.py +++ b/src/app/generator.py @@ -4,107 +4,113 @@ from app import api from app.utils import get_repository_name, write_json, read_json, create_if_not_exists from abc import abstractmethod -class Api(): - _api: api.Api - def __init__(self, name: str, api: api.Api = api.GitHubApi()) -> None: - self.name = name - self._api = api +class Api: + _api: api.Api - @abstractmethod - def generate(self, config, path): - ''' - Generates the api based on the config to the path. + def __init__(self, name: str, api: api.Api = api.GitHubApi()) -> None: + self.name = name + self._api = api + + @abstractmethod + def generate(self, config, path): + """ + Generates the api based on the config to the path. + + Args: + config (dict): The config for the api + path (str): The path where the api should be generated + """ + raise NotImplementedError - Args: - config (dict): The config for the api - path (str): The path where the api should be generated - ''' - raise NotImplementedError class ReleaseApi(Api): - def __init__(self, api) -> None: - super().__init__("release", api) - pass - - def generate(self, config, path): - path = join(path, 'release') + def __init__(self, api) -> None: + super().__init__("release", api) + pass - repositories = config["repositories"] + def generate(self, config, path): + path = join(path, "release") - for repository in repositories: - release = self._api.get_release(repository) - repository_name = get_repository_name(repository) - - tag = release['tag'] - - release_path = join(path, repository_name) - release_json = json.dumps(release) - - create_if_not_exists(release_path) - - write_json(release_json, join(release_path, f'{tag}.json'), overwrite=False) - write_json(release_json, join(release_path, 'latest.json')) # Overwrite the latest release - - # At last join the current tag to an index file - index_path = join(path, f'{repository_name}.json') - - index = read_json(index_path, []) - if tag not in index: # TODO: Check if there a better way to do this - index.append(tag) # Add the current tag to the index + repositories = config["repositories"] + + for repository in repositories: + release = self._api.get_release(repository) + repository_name = get_repository_name(repository) + + tag = release["tag"] + + release_path = join(path, repository_name) + release_json = json.dumps(release) + + create_if_not_exists(release_path) + + write_json(release_json, join(release_path, f"{tag}.json"), overwrite=False) + write_json( + release_json, join(release_path, "latest.json") + ) # Overwrite the latest release + + # At last join the current tag to an index file + index_path = join(path, f"{repository_name}.json") + + index = read_json(index_path, []) + if tag not in index: # TODO: Check if there a better way to do this + index.append(tag) # Add the current tag to the index + + write_json(index, index_path) - write_json(index, index_path) class ContributorApi(Api): - def __init__(self, api) -> None: - super().__init__("contributor", api) - pass + def __init__(self, api) -> None: + super().__init__("contributor", api) + pass - def generate(self, config, path): - path = join(path, 'contributor') + def generate(self, config, path): + path = join(path, "contributor") - create_if_not_exists(path) - repositories = config["repositories"] + create_if_not_exists(path) + repositories = config["repositories"] - for repository in repositories: - repository_name = get_repository_name(repository) + for repository in repositories: + repository_name = get_repository_name(repository) - contributors = self._api.get_contributor(repository) - contributors_path = join(path, f'{repository_name}.json') + contributors = self._api.get_contributor(repository) + contributors_path = join(path, f"{repository_name}.json") + + write_json(contributors, contributors_path) - write_json(contributors, contributors_path) class SocialApi(Api): - def __init__(self, api) -> None: - super().__init__("social", api) - - def generate(self, config, path): - new_social = config - - social_path = join(path, f"social.json") - social = read_json(social_path, new_social) + def __init__(self, api) -> None: + super().__init__("social", api) - write_json(social, social_path) + def generate(self, config, path): + new_social = config -class ApiProvider(): - _apis: list[Api] + social_path = join(path, f"social.json") + social = read_json(social_path, new_social) - def __init__(self, apis: list[Api]) -> None: - self._apis = apis + write_json(social, social_path) - def get(self, name: str) -> Api: - for api in self._apis: - if api.name == name: - return api - return None +class ApiProvider: + _apis: list[Api] + + def __init__(self, apis: list[Api]) -> None: + self._apis = apis + + def get(self, name: str) -> Api: + for api in self._apis: + if api.name == name: + return api + + return None + class DefaultApiProvider(ApiProvider): - def __init__(self): - self._api = api.GitHubApi() # Use GitHub as default api - - super().__init__([ - ReleaseApi(self._api), - ContributorApi(self._api), - SocialApi(self._api)] - ) + def __init__(self): + self._api = api.GitHubApi() # Use GitHub as default api + + super().__init__( + [ReleaseApi(self._api), ContributorApi(self._api), SocialApi(self._api)] + ) diff --git a/src/app/utils.py b/src/app/utils.py index 643bdf2..91f0e85 100644 --- a/src/app/utils.py +++ b/src/app/utils.py @@ -1,21 +1,25 @@ import json import os + def write_json(text: str | dict | list, to, overwrite=True): - if not os.path.exists(to) or overwrite: - with open(to, 'w') as f: - if not isinstance(text, str): - text = json.dumps(text) - f.write(text) + if not os.path.exists(to) or overwrite: + with open(to, "w") as f: + if not isinstance(text, str): + text = json.dumps(text) + f.write(text) + def read_json(path, default): - if os.path.exists(path): - with open(path, 'r') as f: - return json.load(f) - return default + if os.path.exists(path): + with open(path, "r") as f: + return json.load(f) + return default + def create_if_not_exists(path): - os.makedirs(path, exist_ok=True) + os.makedirs(path, exist_ok=True) + def get_repository_name(repository: str): - return repository.split('/')[-1] \ No newline at end of file + return repository.split("/")[-1] diff --git a/src/main.py b/src/main.py index cb3d2df..845a337 100644 --- a/src/main.py +++ b/src/main.py @@ -3,15 +3,16 @@ from app.generator import DefaultApiProvider config = load_config() -output = config['output'] -apis = config['api'] +output = config["output"] +apis = config["api"] api_provider = DefaultApiProvider() for api in apis: - types = api['type'].split('+') - del api['type'] # Don't need the type for the api anymore below - for type in types: - api_type = api_provider.get(type) - if api_type is None: continue - api_type.generate(api, output) \ No newline at end of file + types = api["type"].split("+") + del api["type"] # Don't need the type for the api anymore below + for type in types: + api_type = api_provider.get(type) + if api_type is None: + continue + api_type.generate(api, output) From 4b4608ddbc0ccb0eba94d70cfaed84a6914b99e8 Mon Sep 17 00:00:00 2001 From: Alexandre Teles Date: Mon, 10 Apr 2023 20:49:40 -0300 Subject: [PATCH 04/30] fix: typing issues --- src/app/api.py | 8 ++++---- src/app/generator.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/app/api.py b/src/app/api.py index 7abcfa2..f242841 100644 --- a/src/app/api.py +++ b/src/app/api.py @@ -4,11 +4,11 @@ import requests class Api: - _api_key: str + _api_key: str | None @abstractmethod - def __init__(self, api_key: str = None) -> None: - self._api_key: str = api_key + def __init__(self, api_key: str | None = None) -> None: + self._api_key = api_key @abstractmethod def get_release( @@ -108,7 +108,7 @@ class GitHubApi(Api): ).json() return list(map(transform_release, releases)) # List might not be needed. else: - latest_release: object = requests.get( + latest_release: dict = requests.get( f"https://api.github.com/repos/{repository}/releases/latest?prerelease={prerelease}" ).json() return transform_release(latest_release) diff --git a/src/app/generator.py b/src/app/generator.py index e3dfd8c..718c9bf 100644 --- a/src/app/generator.py +++ b/src/app/generator.py @@ -99,7 +99,7 @@ class ApiProvider: def __init__(self, apis: list[Api]) -> None: self._apis = apis - def get(self, name: str) -> Api: + def get(self, name: str) -> Api | None: for api in self._apis: if api.name == name: return api From 078a8da77fed17ee605f5e9a67a1c4b5eee87050 Mon Sep 17 00:00:00 2001 From: Alexandre Teles Date: Mon, 10 Apr 2023 21:04:52 -0300 Subject: [PATCH 05/30] refactor: remove type hinting from init methods --- src/app/api.py | 4 ++-- src/app/generator.py | 12 +++++------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/app/api.py b/src/app/api.py index f242841..f37bacd 100644 --- a/src/app/api.py +++ b/src/app/api.py @@ -7,7 +7,7 @@ class Api: _api_key: str | None @abstractmethod - def __init__(self, api_key: str | None = None) -> None: + def __init__(self, api_key: str | None = None): self._api_key = api_key @abstractmethod @@ -36,7 +36,7 @@ class Api: class GitHubApi(Api): - def __init__(self) -> None: + def __init__(self): pass def get_contributor(self, repository): diff --git a/src/app/generator.py b/src/app/generator.py index 718c9bf..44aec0b 100644 --- a/src/app/generator.py +++ b/src/app/generator.py @@ -8,7 +8,7 @@ from abc import abstractmethod class Api: _api: api.Api - def __init__(self, name: str, api: api.Api = api.GitHubApi()) -> None: + def __init__(self, name: str, api: api.Api = api.GitHubApi()): self.name = name self._api = api @@ -25,9 +25,8 @@ class Api: class ReleaseApi(Api): - def __init__(self, api) -> None: + def __init__(self, api): super().__init__("release", api) - pass def generate(self, config, path): path = join(path, "release") @@ -61,9 +60,8 @@ class ReleaseApi(Api): class ContributorApi(Api): - def __init__(self, api) -> None: + def __init__(self, api): super().__init__("contributor", api) - pass def generate(self, config, path): path = join(path, "contributor") @@ -81,7 +79,7 @@ class ContributorApi(Api): class SocialApi(Api): - def __init__(self, api) -> None: + def __init__(self, api): super().__init__("social", api) def generate(self, config, path): @@ -96,7 +94,7 @@ class SocialApi(Api): class ApiProvider: _apis: list[Api] - def __init__(self, apis: list[Api]) -> None: + def __init__(self, apis: list[Api]): self._apis = apis def get(self, name: str) -> Api | None: From 1a6b1e7fff67df936ed313be024b57420687c2d2 Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Sun, 23 Apr 2023 04:34:58 +0200 Subject: [PATCH 06/30] feat: add more generators --- config.example.json | 11 +++++++++++ src/app/api.py | 32 ++++++++++++++++++++++++++++++++ src/app/generator.py | 42 ++++++++++++++++++++++++++++++++++-------- 3 files changed, 77 insertions(+), 8 deletions(-) diff --git a/config.example.json b/config.example.json index bee0bad..c6b5f34 100644 --- a/config.example.json +++ b/config.example.json @@ -11,6 +11,17 @@ "socials": { "website": "https://yourwebsite.com" } + }, + { + "type": "team", + "organization": "yourorg" + }, + { + "type": "donation", + "links": { + "liberapay": "https://liberapay.com/yourteam", + "github": "https://github.com/sponsors/yourteam" + } } ], "output": "static" diff --git a/src/app/api.py b/src/app/api.py index f37bacd..2025733 100644 --- a/src/app/api.py +++ b/src/app/api.py @@ -35,6 +35,16 @@ class Api: raise NotImplementedError + @abstractmethod + def get_members(self, organization): + '''Gets the team for an organization. + + Args: + organization (str): The organization to get the team for. + ''' + raise NotImplementedError + + class GitHubApi(Api): def __init__(self): pass @@ -112,3 +122,25 @@ class GitHubApi(Api): f"https://api.github.com/repos/{repository}/releases/latest?prerelease={prerelease}" ).json() return transform_release(latest_release) + + def get_members(self, organization): + def transform_team_member(member: dict) -> dict: + '''Transforms a team member into a dict. + + Args: + member (dict): The member to transform. + + Returns: + dict: The transformed member. + ''' + + return { + 'username': member['login'], + 'avatar': member['avatar_url'], # TODO: Proxy via a CDN. + 'link': member['html_url'] + } + + members = requests.get( + f'https://api.github.com/orgs/{organization}/members').json() + # List might not be needed. + return list(map(transform_team_member, members)) \ No newline at end of file diff --git a/src/app/generator.py b/src/app/generator.py index 44aec0b..8ef3bca 100644 --- a/src/app/generator.py +++ b/src/app/generator.py @@ -83,13 +83,35 @@ class SocialApi(Api): super().__init__("social", api) def generate(self, config, path): - new_social = config + new_social = config["socials"] social_path = join(path, f"social.json") - social = read_json(social_path, new_social) - write_json(social, social_path) + write_json(new_social, social_path) +class TeamApi(Api): + def __init__(self, api): + super().__init__("team", api) + + def generate(self, config, path): + organization = config["organization"] + + team = self._api.get_members(organization) + + team_path = join(path, f"team.json") + + write_json(team, team_path) + +class DonationApi(Api): + def __init__(self, api): + super().__init__("donation", api) + + def generate(self, config, path): + donation = config["links"] + + donation_path = join(path, f"donation.json") + + write_json(donation, donation_path) class ApiProvider: _apis: list[Api] @@ -107,8 +129,12 @@ class ApiProvider: class DefaultApiProvider(ApiProvider): def __init__(self): - self._api = api.GitHubApi() # Use GitHub as default api - - super().__init__( - [ReleaseApi(self._api), ContributorApi(self._api), SocialApi(self._api)] - ) + self._api = api.GitHubApi() # Use GitHub as default api + + super().__init__([ + ReleaseApi(self._api), + ContributorApi(self._api), + SocialApi(self._api), + TeamApi(self._api), + DonationApi(self._api) + ]) From 7974713f3b663326e864743af30ea2536d6764fb Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Sun, 29 Oct 2023 22:42:42 +0100 Subject: [PATCH 07/30] fix: Update CNAME --- CNAME | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CNAME b/CNAME index 2de080c..9f1ffe6 100644 --- a/CNAME +++ b/CNAME @@ -1 +1 @@ -static-api.osumatrix.me \ No newline at end of file +static-api.revanced.app \ No newline at end of file From 40cfd1150e9d67ee1eec5828fe7a155b1d7be5a5 Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Sun, 29 Oct 2023 22:43:32 +0100 Subject: [PATCH 08/30] docs: Update repository information --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 2a69f8b..efacec6 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Static API -Proof of concept repository to host a static API using GitHub workflows. +Repository to host a static API using GitHub workflows. ## How it works @@ -22,8 +22,8 @@ The following API configuration generates the `contributor` and `release` API fo } ``` -All static files are generated in the output path specified in the configuration. +All static files are generated in the output path specified in the configuration. ## Setup -A repository variable `CONFIG` is expected by CD with the configuration (string escaped) which will be used by CD to generate the static files. \ No newline at end of file +A repository variable `CONFIG` is expected by CD with the configuration (string escaped) which will be used by CD to generate the static files. From a945d75023e51abc226a0cdd454ca54b32703af2 Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Sun, 29 Oct 2023 22:48:09 +0100 Subject: [PATCH 09/30] ci: Correct step names --- .github/workflows/update.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/update.yml b/.github/workflows/update.yml index d698a70..ef8143f 100644 --- a/.github/workflows/update.yml +++ b/.github/workflows/update.yml @@ -1,4 +1,4 @@ -name: Update static API +name: Update static files on: repository_dispatch: @@ -6,7 +6,7 @@ on: jobs: update: - name: Update static API + name: Update static files runs-on: ubuntu-latest steps: - name: Clone repository @@ -19,10 +19,10 @@ jobs: with: python-version: 3.11.3 - - name: Create configuration file + - name: Write config file run: echo "${{ vars.CONFIG }}" > config.json - - name: Check for existing deployment exists + - name: Check if a deployment exists run: | if git ls-remote --exit-code --heads origin gh-pages; then echo "::set-output name=deployment-exists::true" @@ -38,7 +38,7 @@ jobs: git config user.email github@revanced.app git subtree add --prefix=static/ origin/gh-pages --squash - - name: Update static API + - name: Update static files run: | pip install requests python src/main.py @@ -46,7 +46,7 @@ jobs: - name: Commit changes uses: EndBug/add-and-commit@v9 with: - message: "chore: updated static files" + message: "chore: Update static files" fetch: false push: false From f635868994ae0d5fcb7d3ad2d80885a699da2333 Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Sun, 29 Oct 2023 22:48:42 +0100 Subject: [PATCH 10/30] fix: Move files to TLD --- {src/app => app}/__init__.py | 0 {src/app => app}/api.py | 0 {src/app => app}/config.py | 0 {src/app => app}/generator.py | 0 {src/app => app}/utils.py | 0 src/main.py => main.py | 0 6 files changed, 0 insertions(+), 0 deletions(-) rename {src/app => app}/__init__.py (100%) rename {src/app => app}/api.py (100%) rename {src/app => app}/config.py (100%) rename {src/app => app}/generator.py (100%) rename {src/app => app}/utils.py (100%) rename src/main.py => main.py (100%) diff --git a/src/app/__init__.py b/app/__init__.py similarity index 100% rename from src/app/__init__.py rename to app/__init__.py diff --git a/src/app/api.py b/app/api.py similarity index 100% rename from src/app/api.py rename to app/api.py diff --git a/src/app/config.py b/app/config.py similarity index 100% rename from src/app/config.py rename to app/config.py diff --git a/src/app/generator.py b/app/generator.py similarity index 100% rename from src/app/generator.py rename to app/generator.py diff --git a/src/app/utils.py b/app/utils.py similarity index 100% rename from src/app/utils.py rename to app/utils.py diff --git a/src/main.py b/main.py similarity index 100% rename from src/main.py rename to main.py From ac35644962dd8841653017946146fb66d5be4472 Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Sun, 29 Oct 2023 22:54:52 +0100 Subject: [PATCH 11/30] build: Bump version --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index d8f4e5e..acd2622 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "revanced-static-api" -version = "0.0.1" +version = "0.1.0" description = "Static API for ReVanced" authors = ["Alexandre Teles ", "oSumAtrIX "] license = "GPLv3" From 318fa8b47d831d9657a452f8f548f54596626c8d Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Sun, 29 Oct 2023 22:56:38 +0100 Subject: [PATCH 12/30] chore: Format code --- app/api.py | 6 +++--- app/generator.py | 10 +++++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/app/api.py b/app/api.py index 2025733..e12e830 100644 --- a/app/api.py +++ b/app/api.py @@ -34,7 +34,6 @@ class Api: """ raise NotImplementedError - @abstractmethod def get_members(self, organization): '''Gets the team for an organization. @@ -116,7 +115,8 @@ class GitHubApi(Api): releases: list = requests.get( f"https://api.github.com/repos/{repository}/releases" ).json() - return list(map(transform_release, releases)) # List might not be needed. + # List might not be needed. + return list(map(transform_release, releases)) else: latest_release: dict = requests.get( f"https://api.github.com/repos/{repository}/releases/latest?prerelease={prerelease}" @@ -143,4 +143,4 @@ class GitHubApi(Api): members = requests.get( f'https://api.github.com/orgs/{organization}/members').json() # List might not be needed. - return list(map(transform_team_member, members)) \ No newline at end of file + return list(map(transform_team_member, members)) diff --git a/app/generator.py b/app/generator.py index 8ef3bca..c57bb8b 100644 --- a/app/generator.py +++ b/app/generator.py @@ -44,7 +44,8 @@ class ReleaseApi(Api): create_if_not_exists(release_path) - write_json(release_json, join(release_path, f"{tag}.json"), overwrite=False) + write_json(release_json, join( + release_path, f"{tag}.json"), overwrite=False) write_json( release_json, join(release_path, "latest.json") ) # Overwrite the latest release @@ -89,6 +90,7 @@ class SocialApi(Api): write_json(new_social, social_path) + class TeamApi(Api): def __init__(self, api): super().__init__("team", api) @@ -102,6 +104,7 @@ class TeamApi(Api): write_json(team, team_path) + class DonationApi(Api): def __init__(self, api): super().__init__("donation", api) @@ -113,6 +116,7 @@ class DonationApi(Api): write_json(donation, donation_path) + class ApiProvider: _apis: list[Api] @@ -129,8 +133,8 @@ class ApiProvider: class DefaultApiProvider(ApiProvider): def __init__(self): - self._api = api.GitHubApi() # Use GitHub as default api - + self._api = api.GitHubApi() # Use GitHub as default api + super().__init__([ ReleaseApi(self._api), ContributorApi(self._api), From 970dcc19aadde7b402b9c9d8c3243f7355069949 Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Sun, 29 Oct 2023 22:56:49 +0100 Subject: [PATCH 13/30] chore: Update dependencies --- poetry.lock | 228 ++++++++++++++++++++++++++-------------------------- 1 file changed, 113 insertions(+), 115 deletions(-) diff --git a/poetry.lock b/poetry.lock index fcdfb76..2cccf11 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,107 +1,119 @@ -# This file is automatically @generated by Poetry and should not be changed by hand. +# This file is automatically @generated by Poetry 1.6.1 and should not be changed by hand. [[package]] name = "certifi" -version = "2022.12.7" +version = "2023.7.22" description = "Python package for providing Mozilla's CA Bundle." -category = "main" optional = false python-versions = ">=3.6" files = [ - {file = "certifi-2022.12.7-py3-none-any.whl", hash = "sha256:4ad3232f5e926d6718ec31cfc1fcadfde020920e278684144551c91769c7bc18"}, - {file = "certifi-2022.12.7.tar.gz", hash = "sha256:35824b4c3a97115964b408844d64aa14db1cc518f6562e8d7261699d1350a9e3"}, + {file = "certifi-2023.7.22-py3-none-any.whl", hash = "sha256:92d6037539857d8206b8f6ae472e8b77db8058fec5937a1ef3f54304089edbb9"}, + {file = "certifi-2023.7.22.tar.gz", hash = "sha256:539cc1d13202e33ca466e88b2807e29f4c13049d6d87031a3c110744495cb082"}, ] [[package]] name = "charset-normalizer" -version = "3.1.0" +version = "3.3.1" description = "The Real First Universal Charset Detector. Open, modern and actively maintained alternative to Chardet." -category = "main" optional = false python-versions = ">=3.7.0" files = [ - {file = "charset-normalizer-3.1.0.tar.gz", hash = "sha256:34e0a2f9c370eb95597aae63bf85eb5e96826d81e3dcf88b8886012906f509b5"}, - {file = "charset_normalizer-3.1.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:e0ac8959c929593fee38da1c2b64ee9778733cdf03c482c9ff1d508b6b593b2b"}, - {file = "charset_normalizer-3.1.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:d7fc3fca01da18fbabe4625d64bb612b533533ed10045a2ac3dd194bfa656b60"}, - {file = "charset_normalizer-3.1.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:04eefcee095f58eaabe6dc3cc2262f3bcd776d2c67005880894f447b3f2cb9c1"}, - {file = "charset_normalizer-3.1.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:20064ead0717cf9a73a6d1e779b23d149b53daf971169289ed2ed43a71e8d3b0"}, - {file = "charset_normalizer-3.1.0-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1435ae15108b1cb6fffbcea2af3d468683b7afed0169ad718451f8db5d1aff6f"}, - {file = "charset_normalizer-3.1.0-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:c84132a54c750fda57729d1e2599bb598f5fa0344085dbde5003ba429a4798c0"}, - {file = "charset_normalizer-3.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:75f2568b4189dda1c567339b48cba4ac7384accb9c2a7ed655cd86b04055c795"}, - {file = "charset_normalizer-3.1.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:11d3bcb7be35e7b1bba2c23beedac81ee893ac9871d0ba79effc7fc01167db6c"}, - {file = "charset_normalizer-3.1.0-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:891cf9b48776b5c61c700b55a598621fdb7b1e301a550365571e9624f270c203"}, - {file = "charset_normalizer-3.1.0-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:5f008525e02908b20e04707a4f704cd286d94718f48bb33edddc7d7b584dddc1"}, - {file = "charset_normalizer-3.1.0-cp310-cp310-musllinux_1_1_ppc64le.whl", hash = "sha256:b06f0d3bf045158d2fb8837c5785fe9ff9b8c93358be64461a1089f5da983137"}, - {file = "charset_normalizer-3.1.0-cp310-cp310-musllinux_1_1_s390x.whl", hash = "sha256:49919f8400b5e49e961f320c735388ee686a62327e773fa5b3ce6721f7e785ce"}, - {file = "charset_normalizer-3.1.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:22908891a380d50738e1f978667536f6c6b526a2064156203d418f4856d6e86a"}, - {file = "charset_normalizer-3.1.0-cp310-cp310-win32.whl", hash = "sha256:12d1a39aa6b8c6f6248bb54550efcc1c38ce0d8096a146638fd4738e42284448"}, - {file = "charset_normalizer-3.1.0-cp310-cp310-win_amd64.whl", hash = "sha256:65ed923f84a6844de5fd29726b888e58c62820e0769b76565480e1fdc3d062f8"}, - {file = "charset_normalizer-3.1.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:9a3267620866c9d17b959a84dd0bd2d45719b817245e49371ead79ed4f710d19"}, - {file = "charset_normalizer-3.1.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:6734e606355834f13445b6adc38b53c0fd45f1a56a9ba06c2058f86893ae8017"}, - {file = "charset_normalizer-3.1.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:f8303414c7b03f794347ad062c0516cee0e15f7a612abd0ce1e25caf6ceb47df"}, - {file = "charset_normalizer-3.1.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:aaf53a6cebad0eae578f062c7d462155eada9c172bd8c4d250b8c1d8eb7f916a"}, - {file = "charset_normalizer-3.1.0-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:3dc5b6a8ecfdc5748a7e429782598e4f17ef378e3e272eeb1340ea57c9109f41"}, - {file = "charset_normalizer-3.1.0-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:e1b25e3ad6c909f398df8921780d6a3d120d8c09466720226fc621605b6f92b1"}, - {file = "charset_normalizer-3.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0ca564606d2caafb0abe6d1b5311c2649e8071eb241b2d64e75a0d0065107e62"}, - {file = "charset_normalizer-3.1.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b82fab78e0b1329e183a65260581de4375f619167478dddab510c6c6fb04d9b6"}, - {file = "charset_normalizer-3.1.0-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:bd7163182133c0c7701b25e604cf1611c0d87712e56e88e7ee5d72deab3e76b5"}, - {file = "charset_normalizer-3.1.0-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:11d117e6c63e8f495412d37e7dc2e2fff09c34b2d09dbe2bee3c6229577818be"}, - {file = "charset_normalizer-3.1.0-cp311-cp311-musllinux_1_1_ppc64le.whl", hash = "sha256:cf6511efa4801b9b38dc5546d7547d5b5c6ef4b081c60b23e4d941d0eba9cbeb"}, - {file = "charset_normalizer-3.1.0-cp311-cp311-musllinux_1_1_s390x.whl", hash = "sha256:abc1185d79f47c0a7aaf7e2412a0eb2c03b724581139193d2d82b3ad8cbb00ac"}, - {file = "charset_normalizer-3.1.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:cb7b2ab0188829593b9de646545175547a70d9a6e2b63bf2cd87a0a391599324"}, - {file = "charset_normalizer-3.1.0-cp311-cp311-win32.whl", hash = "sha256:c36bcbc0d5174a80d6cccf43a0ecaca44e81d25be4b7f90f0ed7bcfbb5a00909"}, - {file = "charset_normalizer-3.1.0-cp311-cp311-win_amd64.whl", hash = "sha256:cca4def576f47a09a943666b8f829606bcb17e2bc2d5911a46c8f8da45f56755"}, - {file = "charset_normalizer-3.1.0-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:0c95f12b74681e9ae127728f7e5409cbbef9cd914d5896ef238cc779b8152373"}, - {file = "charset_normalizer-3.1.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:fca62a8301b605b954ad2e9c3666f9d97f63872aa4efcae5492baca2056b74ab"}, - {file = "charset_normalizer-3.1.0-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ac0aa6cd53ab9a31d397f8303f92c42f534693528fafbdb997c82bae6e477ad9"}, - {file = "charset_normalizer-3.1.0-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:c3af8e0f07399d3176b179f2e2634c3ce9c1301379a6b8c9c9aeecd481da494f"}, - {file = "charset_normalizer-3.1.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3a5fc78f9e3f501a1614a98f7c54d3969f3ad9bba8ba3d9b438c3bc5d047dd28"}, - {file = "charset_normalizer-3.1.0-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:628c985afb2c7d27a4800bfb609e03985aaecb42f955049957814e0491d4006d"}, - {file = "charset_normalizer-3.1.0-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:74db0052d985cf37fa111828d0dd230776ac99c740e1a758ad99094be4f1803d"}, - {file = "charset_normalizer-3.1.0-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:1e8fcdd8f672a1c4fc8d0bd3a2b576b152d2a349782d1eb0f6b8e52e9954731d"}, - {file = "charset_normalizer-3.1.0-cp37-cp37m-musllinux_1_1_ppc64le.whl", hash = "sha256:04afa6387e2b282cf78ff3dbce20f0cc071c12dc8f685bd40960cc68644cfea6"}, - {file = "charset_normalizer-3.1.0-cp37-cp37m-musllinux_1_1_s390x.whl", hash = "sha256:dd5653e67b149503c68c4018bf07e42eeed6b4e956b24c00ccdf93ac79cdff84"}, - {file = "charset_normalizer-3.1.0-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:d2686f91611f9e17f4548dbf050e75b079bbc2a82be565832bc8ea9047b61c8c"}, - {file = "charset_normalizer-3.1.0-cp37-cp37m-win32.whl", hash = "sha256:4155b51ae05ed47199dc5b2a4e62abccb274cee6b01da5b895099b61b1982974"}, - {file = "charset_normalizer-3.1.0-cp37-cp37m-win_amd64.whl", hash = "sha256:322102cdf1ab682ecc7d9b1c5eed4ec59657a65e1c146a0da342b78f4112db23"}, - {file = "charset_normalizer-3.1.0-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:e633940f28c1e913615fd624fcdd72fdba807bf53ea6925d6a588e84e1151531"}, - {file = "charset_normalizer-3.1.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:3a06f32c9634a8705f4ca9946d667609f52cf130d5548881401f1eb2c39b1e2c"}, - {file = "charset_normalizer-3.1.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:7381c66e0561c5757ffe616af869b916c8b4e42b367ab29fedc98481d1e74e14"}, - {file = "charset_normalizer-3.1.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3573d376454d956553c356df45bb824262c397c6e26ce43e8203c4c540ee0acb"}, - {file = "charset_normalizer-3.1.0-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e89df2958e5159b811af9ff0f92614dabf4ff617c03a4c1c6ff53bf1c399e0e1"}, - {file = "charset_normalizer-3.1.0-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:78cacd03e79d009d95635e7d6ff12c21eb89b894c354bd2b2ed0b4763373693b"}, - {file = "charset_normalizer-3.1.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:de5695a6f1d8340b12a5d6d4484290ee74d61e467c39ff03b39e30df62cf83a0"}, - {file = "charset_normalizer-3.1.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1c60b9c202d00052183c9be85e5eaf18a4ada0a47d188a83c8f5c5b23252f649"}, - {file = "charset_normalizer-3.1.0-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:f645caaf0008bacf349875a974220f1f1da349c5dbe7c4ec93048cdc785a3326"}, - {file = "charset_normalizer-3.1.0-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:ea9f9c6034ea2d93d9147818f17c2a0860d41b71c38b9ce4d55f21b6f9165a11"}, - {file = "charset_normalizer-3.1.0-cp38-cp38-musllinux_1_1_ppc64le.whl", hash = "sha256:80d1543d58bd3d6c271b66abf454d437a438dff01c3e62fdbcd68f2a11310d4b"}, - {file = "charset_normalizer-3.1.0-cp38-cp38-musllinux_1_1_s390x.whl", hash = "sha256:73dc03a6a7e30b7edc5b01b601e53e7fc924b04e1835e8e407c12c037e81adbd"}, - {file = "charset_normalizer-3.1.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:6f5c2e7bc8a4bf7c426599765b1bd33217ec84023033672c1e9a8b35eaeaaaf8"}, - {file = "charset_normalizer-3.1.0-cp38-cp38-win32.whl", hash = "sha256:12a2b561af122e3d94cdb97fe6fb2bb2b82cef0cdca131646fdb940a1eda04f0"}, - {file = "charset_normalizer-3.1.0-cp38-cp38-win_amd64.whl", hash = "sha256:3160a0fd9754aab7d47f95a6b63ab355388d890163eb03b2d2b87ab0a30cfa59"}, - {file = "charset_normalizer-3.1.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:38e812a197bf8e71a59fe55b757a84c1f946d0ac114acafaafaf21667a7e169e"}, - {file = "charset_normalizer-3.1.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:6baf0baf0d5d265fa7944feb9f7451cc316bfe30e8df1a61b1bb08577c554f31"}, - {file = "charset_normalizer-3.1.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:8f25e17ab3039b05f762b0a55ae0b3632b2e073d9c8fc88e89aca31a6198e88f"}, - {file = "charset_normalizer-3.1.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3747443b6a904001473370d7810aa19c3a180ccd52a7157aacc264a5ac79265e"}, - {file = "charset_normalizer-3.1.0-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:b116502087ce8a6b7a5f1814568ccbd0e9f6cfd99948aa59b0e241dc57cf739f"}, - {file = "charset_normalizer-3.1.0-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:d16fd5252f883eb074ca55cb622bc0bee49b979ae4e8639fff6ca3ff44f9f854"}, - {file = "charset_normalizer-3.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:21fa558996782fc226b529fdd2ed7866c2c6ec91cee82735c98a197fae39f706"}, - {file = "charset_normalizer-3.1.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:6f6c7a8a57e9405cad7485f4c9d3172ae486cfef1344b5ddd8e5239582d7355e"}, - {file = "charset_normalizer-3.1.0-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:ac3775e3311661d4adace3697a52ac0bab17edd166087d493b52d4f4f553f9f0"}, - {file = "charset_normalizer-3.1.0-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:10c93628d7497c81686e8e5e557aafa78f230cd9e77dd0c40032ef90c18f2230"}, - {file = "charset_normalizer-3.1.0-cp39-cp39-musllinux_1_1_ppc64le.whl", hash = "sha256:6f4f4668e1831850ebcc2fd0b1cd11721947b6dc7c00bf1c6bd3c929ae14f2c7"}, - {file = "charset_normalizer-3.1.0-cp39-cp39-musllinux_1_1_s390x.whl", hash = "sha256:0be65ccf618c1e7ac9b849c315cc2e8a8751d9cfdaa43027d4f6624bd587ab7e"}, - {file = "charset_normalizer-3.1.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:53d0a3fa5f8af98a1e261de6a3943ca631c526635eb5817a87a59d9a57ebf48f"}, - {file = "charset_normalizer-3.1.0-cp39-cp39-win32.whl", hash = "sha256:a04f86f41a8916fe45ac5024ec477f41f886b3c435da2d4e3d2709b22ab02af1"}, - {file = "charset_normalizer-3.1.0-cp39-cp39-win_amd64.whl", hash = "sha256:830d2948a5ec37c386d3170c483063798d7879037492540f10a475e3fd6f244b"}, - {file = "charset_normalizer-3.1.0-py3-none-any.whl", hash = "sha256:3d9098b479e78c85080c98e1e35ff40b4a31d8953102bb0fd7d1b6f8a2111a3d"}, + {file = "charset-normalizer-3.3.1.tar.gz", hash = "sha256:d9137a876020661972ca6eec0766d81aef8a5627df628b664b234b73396e727e"}, + {file = "charset_normalizer-3.3.1-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:8aee051c89e13565c6bd366813c386939f8e928af93c29fda4af86d25b73d8f8"}, + {file = "charset_normalizer-3.3.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:352a88c3df0d1fa886562384b86f9a9e27563d4704ee0e9d56ec6fcd270ea690"}, + {file = "charset_normalizer-3.3.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:223b4d54561c01048f657fa6ce41461d5ad8ff128b9678cfe8b2ecd951e3f8a2"}, + {file = "charset_normalizer-3.3.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4f861d94c2a450b974b86093c6c027888627b8082f1299dfd5a4bae8e2292821"}, + {file = "charset_normalizer-3.3.1-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1171ef1fc5ab4693c5d151ae0fdad7f7349920eabbaca6271f95969fa0756c2d"}, + {file = "charset_normalizer-3.3.1-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:28f512b9a33235545fbbdac6a330a510b63be278a50071a336afc1b78781b147"}, + {file = "charset_normalizer-3.3.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c0e842112fe3f1a4ffcf64b06dc4c61a88441c2f02f373367f7b4c1aa9be2ad5"}, + {file = "charset_normalizer-3.3.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3f9bc2ce123637a60ebe819f9fccc614da1bcc05798bbbaf2dd4ec91f3e08846"}, + {file = "charset_normalizer-3.3.1-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:f194cce575e59ffe442c10a360182a986535fd90b57f7debfaa5c845c409ecc3"}, + {file = "charset_normalizer-3.3.1-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:9a74041ba0bfa9bc9b9bb2cd3238a6ab3b7618e759b41bd15b5f6ad958d17605"}, + {file = "charset_normalizer-3.3.1-cp310-cp310-musllinux_1_1_ppc64le.whl", hash = "sha256:b578cbe580e3b41ad17b1c428f382c814b32a6ce90f2d8e39e2e635d49e498d1"}, + {file = "charset_normalizer-3.3.1-cp310-cp310-musllinux_1_1_s390x.whl", hash = "sha256:6db3cfb9b4fcecb4390db154e75b49578c87a3b9979b40cdf90d7e4b945656e1"}, + {file = "charset_normalizer-3.3.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:debb633f3f7856f95ad957d9b9c781f8e2c6303ef21724ec94bea2ce2fcbd056"}, + {file = "charset_normalizer-3.3.1-cp310-cp310-win32.whl", hash = "sha256:87071618d3d8ec8b186d53cb6e66955ef2a0e4fa63ccd3709c0c90ac5a43520f"}, + {file = "charset_normalizer-3.3.1-cp310-cp310-win_amd64.whl", hash = "sha256:e372d7dfd154009142631de2d316adad3cc1c36c32a38b16a4751ba78da2a397"}, + {file = "charset_normalizer-3.3.1-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:ae4070f741f8d809075ef697877fd350ecf0b7c5837ed68738607ee0a2c572cf"}, + {file = "charset_normalizer-3.3.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:58e875eb7016fd014c0eea46c6fa92b87b62c0cb31b9feae25cbbe62c919f54d"}, + {file = "charset_normalizer-3.3.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:dbd95e300367aa0827496fe75a1766d198d34385a58f97683fe6e07f89ca3e3c"}, + {file = "charset_normalizer-3.3.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:de0b4caa1c8a21394e8ce971997614a17648f94e1cd0640fbd6b4d14cab13a72"}, + {file = "charset_normalizer-3.3.1-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:985c7965f62f6f32bf432e2681173db41336a9c2611693247069288bcb0c7f8b"}, + {file = "charset_normalizer-3.3.1-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a15c1fe6d26e83fd2e5972425a772cca158eae58b05d4a25a4e474c221053e2d"}, + {file = "charset_normalizer-3.3.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ae55d592b02c4349525b6ed8f74c692509e5adffa842e582c0f861751701a673"}, + {file = "charset_normalizer-3.3.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:be4d9c2770044a59715eb57c1144dedea7c5d5ae80c68fb9959515037cde2008"}, + {file = "charset_normalizer-3.3.1-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:851cf693fb3aaef71031237cd68699dded198657ec1e76a76eb8be58c03a5d1f"}, + {file = "charset_normalizer-3.3.1-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:31bbaba7218904d2eabecf4feec0d07469284e952a27400f23b6628439439fa7"}, + {file = "charset_normalizer-3.3.1-cp311-cp311-musllinux_1_1_ppc64le.whl", hash = "sha256:871d045d6ccc181fd863a3cd66ee8e395523ebfbc57f85f91f035f50cee8e3d4"}, + {file = "charset_normalizer-3.3.1-cp311-cp311-musllinux_1_1_s390x.whl", hash = "sha256:501adc5eb6cd5f40a6f77fbd90e5ab915c8fd6e8c614af2db5561e16c600d6f3"}, + {file = "charset_normalizer-3.3.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:f5fb672c396d826ca16a022ac04c9dce74e00a1c344f6ad1a0fdc1ba1f332213"}, + {file = "charset_normalizer-3.3.1-cp311-cp311-win32.whl", hash = "sha256:bb06098d019766ca16fc915ecaa455c1f1cd594204e7f840cd6258237b5079a8"}, + {file = "charset_normalizer-3.3.1-cp311-cp311-win_amd64.whl", hash = "sha256:8af5a8917b8af42295e86b64903156b4f110a30dca5f3b5aedea123fbd638bff"}, + {file = "charset_normalizer-3.3.1-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:7ae8e5142dcc7a49168f4055255dbcced01dc1714a90a21f87448dc8d90617d1"}, + {file = "charset_normalizer-3.3.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:5b70bab78accbc672f50e878a5b73ca692f45f5b5e25c8066d748c09405e6a55"}, + {file = "charset_normalizer-3.3.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:5ceca5876032362ae73b83347be8b5dbd2d1faf3358deb38c9c88776779b2e2f"}, + {file = "charset_normalizer-3.3.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:34d95638ff3613849f473afc33f65c401a89f3b9528d0d213c7037c398a51296"}, + {file = "charset_normalizer-3.3.1-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:9edbe6a5bf8b56a4a84533ba2b2f489d0046e755c29616ef8830f9e7d9cf5728"}, + {file = "charset_normalizer-3.3.1-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f6a02a3c7950cafaadcd46a226ad9e12fc9744652cc69f9e5534f98b47f3bbcf"}, + {file = "charset_normalizer-3.3.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:10b8dd31e10f32410751b3430996f9807fc4d1587ca69772e2aa940a82ab571a"}, + {file = "charset_normalizer-3.3.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:edc0202099ea1d82844316604e17d2b175044f9bcb6b398aab781eba957224bd"}, + {file = "charset_normalizer-3.3.1-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:b891a2f68e09c5ef989007fac11476ed33c5c9994449a4e2c3386529d703dc8b"}, + {file = "charset_normalizer-3.3.1-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:71ef3b9be10070360f289aea4838c784f8b851be3ba58cf796262b57775c2f14"}, + {file = "charset_normalizer-3.3.1-cp312-cp312-musllinux_1_1_ppc64le.whl", hash = "sha256:55602981b2dbf8184c098bc10287e8c245e351cd4fdcad050bd7199d5a8bf514"}, + {file = "charset_normalizer-3.3.1-cp312-cp312-musllinux_1_1_s390x.whl", hash = "sha256:46fb9970aa5eeca547d7aa0de5d4b124a288b42eaefac677bde805013c95725c"}, + {file = "charset_normalizer-3.3.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:520b7a142d2524f999447b3a0cf95115df81c4f33003c51a6ab637cbda9d0bf4"}, + {file = "charset_normalizer-3.3.1-cp312-cp312-win32.whl", hash = "sha256:8ec8ef42c6cd5856a7613dcd1eaf21e5573b2185263d87d27c8edcae33b62a61"}, + {file = "charset_normalizer-3.3.1-cp312-cp312-win_amd64.whl", hash = "sha256:baec8148d6b8bd5cee1ae138ba658c71f5b03e0d69d5907703e3e1df96db5e41"}, + {file = "charset_normalizer-3.3.1-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:63a6f59e2d01310f754c270e4a257426fe5a591dc487f1983b3bbe793cf6bac6"}, + {file = "charset_normalizer-3.3.1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1d6bfc32a68bc0933819cfdfe45f9abc3cae3877e1d90aac7259d57e6e0f85b1"}, + {file = "charset_normalizer-3.3.1-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:4f3100d86dcd03c03f7e9c3fdb23d92e32abbca07e7c13ebd7ddfbcb06f5991f"}, + {file = "charset_normalizer-3.3.1-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:39b70a6f88eebe239fa775190796d55a33cfb6d36b9ffdd37843f7c4c1b5dc67"}, + {file = "charset_normalizer-3.3.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4e12f8ee80aa35e746230a2af83e81bd6b52daa92a8afaef4fea4a2ce9b9f4fa"}, + {file = "charset_normalizer-3.3.1-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:7b6cefa579e1237ce198619b76eaa148b71894fb0d6bcf9024460f9bf30fd228"}, + {file = "charset_normalizer-3.3.1-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:61f1e3fb621f5420523abb71f5771a204b33c21d31e7d9d86881b2cffe92c47c"}, + {file = "charset_normalizer-3.3.1-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:4f6e2a839f83a6a76854d12dbebde50e4b1afa63e27761549d006fa53e9aa80e"}, + {file = "charset_normalizer-3.3.1-cp37-cp37m-musllinux_1_1_ppc64le.whl", hash = "sha256:1ec937546cad86d0dce5396748bf392bb7b62a9eeb8c66efac60e947697f0e58"}, + {file = "charset_normalizer-3.3.1-cp37-cp37m-musllinux_1_1_s390x.whl", hash = "sha256:82ca51ff0fc5b641a2d4e1cc8c5ff108699b7a56d7f3ad6f6da9dbb6f0145b48"}, + {file = "charset_normalizer-3.3.1-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:633968254f8d421e70f91c6ebe71ed0ab140220469cf87a9857e21c16687c034"}, + {file = "charset_normalizer-3.3.1-cp37-cp37m-win32.whl", hash = "sha256:c0c72d34e7de5604df0fde3644cc079feee5e55464967d10b24b1de268deceb9"}, + {file = "charset_normalizer-3.3.1-cp37-cp37m-win_amd64.whl", hash = "sha256:63accd11149c0f9a99e3bc095bbdb5a464862d77a7e309ad5938fbc8721235ae"}, + {file = "charset_normalizer-3.3.1-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:5a3580a4fdc4ac05f9e53c57f965e3594b2f99796231380adb2baaab96e22761"}, + {file = "charset_normalizer-3.3.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:2465aa50c9299d615d757c1c888bc6fef384b7c4aec81c05a0172b4400f98557"}, + {file = "charset_normalizer-3.3.1-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:cb7cd68814308aade9d0c93c5bd2ade9f9441666f8ba5aa9c2d4b389cb5e2a45"}, + {file = "charset_normalizer-3.3.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:91e43805ccafa0a91831f9cd5443aa34528c0c3f2cc48c4cb3d9a7721053874b"}, + {file = "charset_normalizer-3.3.1-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:854cc74367180beb327ab9d00f964f6d91da06450b0855cbbb09187bcdb02de5"}, + {file = "charset_normalizer-3.3.1-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:c15070ebf11b8b7fd1bfff7217e9324963c82dbdf6182ff7050519e350e7ad9f"}, + {file = "charset_normalizer-3.3.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2c4c99f98fc3a1835af8179dcc9013f93594d0670e2fa80c83aa36346ee763d2"}, + {file = "charset_normalizer-3.3.1-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3fb765362688821404ad6cf86772fc54993ec11577cd5a92ac44b4c2ba52155b"}, + {file = "charset_normalizer-3.3.1-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:dced27917823df984fe0c80a5c4ad75cf58df0fbfae890bc08004cd3888922a2"}, + {file = "charset_normalizer-3.3.1-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:a66bcdf19c1a523e41b8e9d53d0cedbfbac2e93c649a2e9502cb26c014d0980c"}, + {file = "charset_normalizer-3.3.1-cp38-cp38-musllinux_1_1_ppc64le.whl", hash = "sha256:ecd26be9f112c4f96718290c10f4caea6cc798459a3a76636b817a0ed7874e42"}, + {file = "charset_normalizer-3.3.1-cp38-cp38-musllinux_1_1_s390x.whl", hash = "sha256:3f70fd716855cd3b855316b226a1ac8bdb3caf4f7ea96edcccc6f484217c9597"}, + {file = "charset_normalizer-3.3.1-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:17a866d61259c7de1bdadef418a37755050ddb4b922df8b356503234fff7932c"}, + {file = "charset_normalizer-3.3.1-cp38-cp38-win32.whl", hash = "sha256:548eefad783ed787b38cb6f9a574bd8664468cc76d1538215d510a3cd41406cb"}, + {file = "charset_normalizer-3.3.1-cp38-cp38-win_amd64.whl", hash = "sha256:45f053a0ece92c734d874861ffe6e3cc92150e32136dd59ab1fb070575189c97"}, + {file = "charset_normalizer-3.3.1-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:bc791ec3fd0c4309a753f95bb6c749ef0d8ea3aea91f07ee1cf06b7b02118f2f"}, + {file = "charset_normalizer-3.3.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:0c8c61fb505c7dad1d251c284e712d4e0372cef3b067f7ddf82a7fa82e1e9a93"}, + {file = "charset_normalizer-3.3.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:2c092be3885a1b7899cd85ce24acedc1034199d6fca1483fa2c3a35c86e43041"}, + {file = "charset_normalizer-3.3.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c2000c54c395d9e5e44c99dc7c20a64dc371f777faf8bae4919ad3e99ce5253e"}, + {file = "charset_normalizer-3.3.1-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:4cb50a0335382aac15c31b61d8531bc9bb657cfd848b1d7158009472189f3d62"}, + {file = "charset_normalizer-3.3.1-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:c30187840d36d0ba2893bc3271a36a517a717f9fd383a98e2697ee890a37c273"}, + {file = "charset_normalizer-3.3.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fe81b35c33772e56f4b6cf62cf4aedc1762ef7162a31e6ac7fe5e40d0149eb67"}, + {file = "charset_normalizer-3.3.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d0bf89afcbcf4d1bb2652f6580e5e55a840fdf87384f6063c4a4f0c95e378656"}, + {file = "charset_normalizer-3.3.1-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:06cf46bdff72f58645434d467bf5228080801298fbba19fe268a01b4534467f5"}, + {file = "charset_normalizer-3.3.1-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:3c66df3f41abee950d6638adc7eac4730a306b022570f71dd0bd6ba53503ab57"}, + {file = "charset_normalizer-3.3.1-cp39-cp39-musllinux_1_1_ppc64le.whl", hash = "sha256:cd805513198304026bd379d1d516afbf6c3c13f4382134a2c526b8b854da1c2e"}, + {file = "charset_normalizer-3.3.1-cp39-cp39-musllinux_1_1_s390x.whl", hash = "sha256:9505dc359edb6a330efcd2be825fdb73ee3e628d9010597aa1aee5aa63442e97"}, + {file = "charset_normalizer-3.3.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:31445f38053476a0c4e6d12b047b08ced81e2c7c712e5a1ad97bc913256f91b2"}, + {file = "charset_normalizer-3.3.1-cp39-cp39-win32.whl", hash = "sha256:bd28b31730f0e982ace8663d108e01199098432a30a4c410d06fe08fdb9e93f4"}, + {file = "charset_normalizer-3.3.1-cp39-cp39-win_amd64.whl", hash = "sha256:555fe186da0068d3354cdf4bbcbc609b0ecae4d04c921cc13e209eece7720727"}, + {file = "charset_normalizer-3.3.1-py3-none-any.whl", hash = "sha256:800561453acdecedaac137bf09cd719c7a440b6800ec182f077bb8e7025fb708"}, ] [[package]] name = "idna" version = "3.4" description = "Internationalized Domain Names in Applications (IDNA)" -category = "main" optional = false python-versions = ">=3.5" files = [ @@ -111,21 +123,20 @@ files = [ [[package]] name = "requests" -version = "2.28.2" +version = "2.31.0" description = "Python HTTP for Humans." -category = "main" optional = false -python-versions = ">=3.7, <4" +python-versions = ">=3.7" files = [ - {file = "requests-2.28.2-py3-none-any.whl", hash = "sha256:64299f4909223da747622c030b781c0d7811e359c37124b4bd368fb8c6518baa"}, - {file = "requests-2.28.2.tar.gz", hash = "sha256:98b1b2782e3c6c4904938b84c0eb932721069dfdb9134313beff7c83c2df24bf"}, + {file = "requests-2.31.0-py3-none-any.whl", hash = "sha256:58cd2187c01e70e6e26505bca751777aa9f2ee0b7f4300988b709f44e013003f"}, + {file = "requests-2.31.0.tar.gz", hash = "sha256:942c5a758f98d790eaed1a29cb6eefc7ffb0d1cf7af05c3d2791656dbd6ad1e1"}, ] [package.dependencies] certifi = ">=2017.4.17" charset-normalizer = ">=2,<4" idna = ">=2.5,<4" -urllib3 = ">=1.21.1,<1.27" +urllib3 = ">=1.21.1,<3" [package.extras] socks = ["PySocks (>=1.5.6,!=1.5.7)"] @@ -133,47 +144,34 @@ use-chardet-on-py3 = ["chardet (>=3.0.2,<6)"] [[package]] name = "types-requests" -version = "2.28.11.17" +version = "2.31.0.10" description = "Typing stubs for requests" -category = "dev" optional = false -python-versions = "*" +python-versions = ">=3.7" files = [ - {file = "types-requests-2.28.11.17.tar.gz", hash = "sha256:0d580652ce903f643f8c3b494dd01d29367ea57cea0c7ad7f65cf3169092edb0"}, - {file = "types_requests-2.28.11.17-py3-none-any.whl", hash = "sha256:cc1aba862575019306b2ed134eb1ea994cab1c887a22e18d3383e6dd42e9789b"}, + {file = "types-requests-2.31.0.10.tar.gz", hash = "sha256:dc5852a76f1eaf60eafa81a2e50aefa3d1f015c34cf0cba130930866b1b22a92"}, + {file = "types_requests-2.31.0.10-py3-none-any.whl", hash = "sha256:b32b9a86beffa876c0c3ac99a4cd3b8b51e973fb8e3bd4e0a6bb32c7efad80fc"}, ] [package.dependencies] -types-urllib3 = "<1.27" - -[[package]] -name = "types-urllib3" -version = "1.26.25.10" -description = "Typing stubs for urllib3" -category = "dev" -optional = false -python-versions = "*" -files = [ - {file = "types-urllib3-1.26.25.10.tar.gz", hash = "sha256:c44881cde9fc8256d05ad6b21f50c4681eb20092552351570ab0a8a0653286d6"}, - {file = "types_urllib3-1.26.25.10-py3-none-any.whl", hash = "sha256:12c744609d588340a07e45d333bf870069fc8793bcf96bae7a96d4712a42591d"}, -] +urllib3 = ">=2" [[package]] name = "urllib3" -version = "1.26.15" +version = "2.0.7" description = "HTTP library with thread-safe connection pooling, file post, and more." -category = "main" optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*" +python-versions = ">=3.7" files = [ - {file = "urllib3-1.26.15-py2.py3-none-any.whl", hash = "sha256:aa751d169e23c7479ce47a0cb0da579e3ede798f994f5816a74e4f4500dcea42"}, - {file = "urllib3-1.26.15.tar.gz", hash = "sha256:8a388717b9476f934a21484e8c8e61875ab60644d29b9b39e11e4b9dc1c6b305"}, + {file = "urllib3-2.0.7-py3-none-any.whl", hash = "sha256:fdb6d215c776278489906c2f8916e6e7d4f5a9b602ccbcfdf7f016fc8da0596e"}, + {file = "urllib3-2.0.7.tar.gz", hash = "sha256:c97dfde1f7bd43a71c8d2a58e369e9b2bf692d1334ea9f9cae55add7d0dd0f84"}, ] [package.extras] -brotli = ["brotli (>=1.0.9)", "brotlicffi (>=0.8.0)", "brotlipy (>=0.6.0)"] -secure = ["certifi", "cryptography (>=1.3.4)", "idna (>=2.0.0)", "ipaddress", "pyOpenSSL (>=0.14)", "urllib3-secure-extra"] -socks = ["PySocks (>=1.5.6,!=1.5.7,<2.0)"] +brotli = ["brotli (>=1.0.9)", "brotlicffi (>=0.8.0)"] +secure = ["certifi", "cryptography (>=1.9)", "idna (>=2.0.0)", "pyopenssl (>=17.1.0)", "urllib3-secure-extra"] +socks = ["pysocks (>=1.5.6,!=1.5.7,<2.0)"] +zstd = ["zstandard (>=0.18.0)"] [metadata] lock-version = "2.0" From 0ccdab156927dad45566f6efb74ae18e0c3015a3 Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Sun, 29 Oct 2023 23:06:50 +0100 Subject: [PATCH 14/30] chore: Ignore static files directory --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 6471f2a..91984e3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ __pycache__ -config.json \ No newline at end of file +config.json +static \ No newline at end of file From 47fcdd1ce3a3da4074524f49707a5c05fd04e227 Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Sun, 29 Oct 2023 23:07:24 +0100 Subject: [PATCH 15/30] feat: Indent generated JSON files This allows easier version control using Git. --- app/generator.py | 4 ++-- app/utils.py | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/app/generator.py b/app/generator.py index c57bb8b..409296a 100644 --- a/app/generator.py +++ b/app/generator.py @@ -1,7 +1,7 @@ import json from os.path import join from app import api -from app.utils import get_repository_name, write_json, read_json, create_if_not_exists +from app.utils import get_repository_name, to_json, write_json, read_json, create_if_not_exists from abc import abstractmethod @@ -40,7 +40,7 @@ class ReleaseApi(Api): tag = release["tag"] release_path = join(path, repository_name) - release_json = json.dumps(release) + release_json = to_json(release) create_if_not_exists(release_path) diff --git a/app/utils.py b/app/utils.py index 91f0e85..5b58bdc 100644 --- a/app/utils.py +++ b/app/utils.py @@ -5,10 +5,13 @@ import os def write_json(text: str | dict | list, to, overwrite=True): if not os.path.exists(to) or overwrite: with open(to, "w") as f: - if not isinstance(text, str): - text = json.dumps(text) + text = to_json(text) f.write(text) +def to_json(text: str | dict | list): + if not isinstance(text, str): + text = json.dumps(text, indent=2) + return text def read_json(path, default): if os.path.exists(path): From 046fb6991af8aa876f1d1bf60e56752ae682c6c0 Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Sun, 29 Oct 2023 23:16:10 +0100 Subject: [PATCH 16/30] feat: Convert `types` object to array --- README.md | 10 +++++----- config.example.json | 16 ++++++++++++---- main.py | 4 +--- 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index efacec6..7967271 100644 --- a/README.md +++ b/README.md @@ -4,10 +4,10 @@ Repository to host a static API using GitHub workflows. ## How it works -On CI trigger static files are generated and commited to the `gh-pages` branch. - -The static files are generated by the configuration provided in a `config.json` file in the root. -The API configuration consists out of an array of objects. Each object is responsible for an API. Based on the provided pair with the key `type` in these objects a method in `generator.py` is selected to generate the API. The objects are passed to the corresponding method to consume additional key-value pairs. +When CI is ran, static files are generated and commited to the `gh-pages` branch. +The file `generator.py` provides a list of static file generator classes. Each class has a name. +The configuration file `config.json` is read which contains the configuration for the API. +By specifying the name of the generator in the `types` array of the configuration, the corresponding generator will be used. The current object of the configuration is passed to the generator. The following API configuration generates the `contributor` and `release` API for selected repositories: @@ -15,7 +15,7 @@ The following API configuration generates the `contributor` and `release` API fo { "api": [ { - "type": "release+contributor", + "types": ["release", "contributor"], "repositories": ["user/repo"] } ] diff --git a/config.example.json b/config.example.json index c6b5f34..858d403 100644 --- a/config.example.json +++ b/config.example.json @@ -1,23 +1,31 @@ { "api": [ { - "type": "release+contributor", + "types": [ + "release+contributor" + ], "repositories": [ "user/repo" ] }, { - "type": "social", + "types": [ + "social" + ], "socials": { "website": "https://yourwebsite.com" } }, { - "type": "team", + "types": [ + "team" + ], "organization": "yourorg" }, { - "type": "donation", + "types": [ + "donation" + ], "links": { "liberapay": "https://liberapay.com/yourteam", "github": "https://github.com/sponsors/yourteam" diff --git a/main.py b/main.py index 845a337..523b9fe 100644 --- a/main.py +++ b/main.py @@ -9,9 +9,7 @@ apis = config["api"] api_provider = DefaultApiProvider() for api in apis: - types = api["type"].split("+") - del api["type"] # Don't need the type for the api anymore below - for type in types: + for type in api["types"]: api_type = api_provider.get(type) if api_type is None: continue From 75eccddc5b31230186360f7c5d7f29a0de477c50 Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Sun, 29 Oct 2023 23:18:05 +0100 Subject: [PATCH 17/30] feat: Rename `types` key to `generators` --- README.md | 4 ++-- config.example.json | 8 ++++---- main.py | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 7967271..ec72310 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ Repository to host a static API using GitHub workflows. When CI is ran, static files are generated and commited to the `gh-pages` branch. The file `generator.py` provides a list of static file generator classes. Each class has a name. The configuration file `config.json` is read which contains the configuration for the API. -By specifying the name of the generator in the `types` array of the configuration, the corresponding generator will be used. The current object of the configuration is passed to the generator. +By specifying the name of the generator in the `generators` array of the configuration, the corresponding generator will be used. The current object of the configuration is passed to the generator. The following API configuration generates the `contributor` and `release` API for selected repositories: @@ -15,7 +15,7 @@ The following API configuration generates the `contributor` and `release` API fo { "api": [ { - "types": ["release", "contributor"], + "generators": ["release", "contributor"], "repositories": ["user/repo"] } ] diff --git a/config.example.json b/config.example.json index 858d403..41caae2 100644 --- a/config.example.json +++ b/config.example.json @@ -1,7 +1,7 @@ { "api": [ { - "types": [ + "generators": [ "release+contributor" ], "repositories": [ @@ -9,7 +9,7 @@ ] }, { - "types": [ + "generators": [ "social" ], "socials": { @@ -17,13 +17,13 @@ } }, { - "types": [ + "generators": [ "team" ], "organization": "yourorg" }, { - "types": [ + "generators": [ "donation" ], "links": { diff --git a/main.py b/main.py index 523b9fe..d628f15 100644 --- a/main.py +++ b/main.py @@ -9,8 +9,8 @@ apis = config["api"] api_provider = DefaultApiProvider() for api in apis: - for type in api["types"]: - api_type = api_provider.get(type) - if api_type is None: + for generator_name in api["generators"]: + generator = api_provider.get(generator_name) + if generator is None: continue - api_type.generate(api, output) + generator.generate(api, output) From 2e02584a9a50a94ef98ecd2fb0192107de91f5f1 Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Sun, 29 Oct 2023 23:23:22 +0100 Subject: [PATCH 18/30] refactor: Rename classes correctly --- app/generator.py | 51 ++++++++++++++++++++++++------------------------ main.py | 4 ++-- 2 files changed, 27 insertions(+), 28 deletions(-) diff --git a/app/generator.py b/app/generator.py index 409296a..6225bb6 100644 --- a/app/generator.py +++ b/app/generator.py @@ -1,30 +1,29 @@ -import json from os.path import join from app import api from app.utils import get_repository_name, to_json, write_json, read_json, create_if_not_exists from abc import abstractmethod -class Api: +class Generator: _api: api.Api - def __init__(self, name: str, api: api.Api = api.GitHubApi()): + def __init__(self, name: str, api: api.Api): self.name = name self._api = api @abstractmethod def generate(self, config, path): """ - Generates the api based on the config to the path. + Generates static files based on the supplied config to the specified path. Args: - config (dict): The config for the api - path (str): The path where the api should be generated + config (dict): The configuration for the generator + path (str): The path to generate the static files to """ raise NotImplementedError -class ReleaseApi(Api): +class ReleaseGenerator(Generator): def __init__(self, api): super().__init__("release", api) @@ -60,7 +59,7 @@ class ReleaseApi(Api): write_json(index, index_path) -class ContributorApi(Api): +class ContributorGenerator(Generator): def __init__(self, api): super().__init__("contributor", api) @@ -79,7 +78,7 @@ class ContributorApi(Api): write_json(contributors, contributors_path) -class SocialApi(Api): +class SocialGenerator(Generator): def __init__(self, api): super().__init__("social", api) @@ -91,7 +90,7 @@ class SocialApi(Api): write_json(new_social, social_path) -class TeamApi(Api): +class TeamGenerator(Generator): def __init__(self, api): super().__init__("team", api) @@ -105,7 +104,7 @@ class TeamApi(Api): write_json(team, team_path) -class DonationApi(Api): +class DonationGenerator(Generator): def __init__(self, api): super().__init__("donation", api) @@ -117,28 +116,28 @@ class DonationApi(Api): write_json(donation, donation_path) -class ApiProvider: - _apis: list[Api] +class GeneratorProvider: + generators: list[Generator] - def __init__(self, apis: list[Api]): - self._apis = apis + def __init__(self, generators: list[Generator]): + self.generators = generators - def get(self, name: str) -> Api | None: - for api in self._apis: - if api.name == name: - return api + def get(self, name: str) -> Generator | None: + for generator in self.generators: + if generator.name == name: + return generator return None -class DefaultApiProvider(ApiProvider): +class DefaultGeneratorProvider(GeneratorProvider): def __init__(self): - self._api = api.GitHubApi() # Use GitHub as default api + self._api = api.GitHubApi() super().__init__([ - ReleaseApi(self._api), - ContributorApi(self._api), - SocialApi(self._api), - TeamApi(self._api), - DonationApi(self._api) + ReleaseGenerator(self._api), + ContributorGenerator(self._api), + SocialGenerator(self._api), + TeamGenerator(self._api), + DonationGenerator(self._api) ]) diff --git a/main.py b/main.py index d628f15..e5c5906 100644 --- a/main.py +++ b/main.py @@ -1,12 +1,12 @@ from app.config import load_config -from app.generator import DefaultApiProvider +from app.generator import DefaultGeneratorProvider config = load_config() output = config["output"] apis = config["api"] -api_provider = DefaultApiProvider() +api_provider = DefaultGeneratorProvider() for api in apis: for generator_name in api["generators"]: From 295d06ec109c96ee6ce9d4ec0beb24fad3415dbb Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Sun, 29 Oct 2023 23:27:35 +0100 Subject: [PATCH 19/30] docs: Add inline docs for generators --- app/generator.py | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/app/generator.py b/app/generator.py index 6225bb6..19722e9 100644 --- a/app/generator.py +++ b/app/generator.py @@ -7,7 +7,12 @@ from abc import abstractmethod class Generator: _api: api.Api - def __init__(self, name: str, api: api.Api): + def __init__(self, name: str, api: api.Api | None = None): + """ + Args: + name (str): The name of the generator + api (Api | None): An optional api to use for the generator. + """ self.name = name self._api = api @@ -24,6 +29,11 @@ class Generator: class ReleaseGenerator(Generator): + """ + Generates a release file for each repository in the config. + The release file is named after the tag of the release and contains the latest release information of the repository. + A `latest.json` file is also generated containing the latest release of the repository. + """ def __init__(self, api): super().__init__("release", api) @@ -60,6 +70,10 @@ class ReleaseGenerator(Generator): class ContributorGenerator(Generator): + """ + Generates a contributor file for each repository in the config. + The contributor file is named after the repository and contains the contributors of the repository. + """ def __init__(self, api): super().__init__("contributor", api) @@ -79,6 +93,9 @@ class ContributorGenerator(Generator): class SocialGenerator(Generator): + """ + Generates a social file containing the social links of the organization. + """ def __init__(self, api): super().__init__("social", api) @@ -91,6 +108,9 @@ class SocialGenerator(Generator): class TeamGenerator(Generator): + """ + Generates a team file containing the members of the organization. + """ def __init__(self, api): super().__init__("team", api) @@ -105,6 +125,9 @@ class TeamGenerator(Generator): class DonationGenerator(Generator): + """ + Generates a donation file containing the donation links of the organization. + """ def __init__(self, api): super().__init__("donation", api) From 1b85bfcda6d346158a2f69a57312d3ea4b6ab9b0 Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Sun, 29 Oct 2023 23:36:03 +0100 Subject: [PATCH 20/30] feat: Rename generators correctly --- app/generator.py | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/app/generator.py b/app/generator.py index 19722e9..30d4615 100644 --- a/app/generator.py +++ b/app/generator.py @@ -28,17 +28,17 @@ class Generator: raise NotImplementedError -class ReleaseGenerator(Generator): +class ReleasesGenerator(Generator): """ Generates a release file for each repository in the config. The release file is named after the tag of the release and contains the latest release information of the repository. A `latest.json` file is also generated containing the latest release of the repository. """ def __init__(self, api): - super().__init__("release", api) + super().__init__("releases", api) def generate(self, config, path): - path = join(path, "release") + path = join(path, "releases") repositories = config["repositories"] @@ -69,16 +69,16 @@ class ReleaseGenerator(Generator): write_json(index, index_path) -class ContributorGenerator(Generator): +class ContributorsGenerator(Generator): """ Generates a contributor file for each repository in the config. The contributor file is named after the repository and contains the contributors of the repository. """ def __init__(self, api): - super().__init__("contributor", api) + super().__init__("contributors", api) def generate(self, config, path): - path = join(path, "contributor") + path = join(path, "contributors") create_if_not_exists(path) repositories = config["repositories"] @@ -92,17 +92,17 @@ class ContributorGenerator(Generator): write_json(contributors, contributors_path) -class SocialGenerator(Generator): +class ConnectionsGenerator(Generator): """ - Generates a social file containing the social links of the organization. + Generates a file containing the connections of the organization. """ def __init__(self, api): - super().__init__("social", api) + super().__init__("connections", api) def generate(self, config, path): - new_social = config["socials"] + new_social = config["connections"] - social_path = join(path, f"social.json") + social_path = join(path, f"connections.json") write_json(new_social, social_path) @@ -124,12 +124,12 @@ class TeamGenerator(Generator): write_json(team, team_path) -class DonationGenerator(Generator): +class DonationsGenerator(Generator): """ Generates a donation file containing the donation links of the organization. """ def __init__(self, api): - super().__init__("donation", api) + super().__init__("donations", api) def generate(self, config, path): donation = config["links"] @@ -158,9 +158,9 @@ class DefaultGeneratorProvider(GeneratorProvider): self._api = api.GitHubApi() super().__init__([ - ReleaseGenerator(self._api), - ContributorGenerator(self._api), - SocialGenerator(self._api), + ReleasesGenerator(self._api), + ContributorsGenerator(self._api), + ConnectionsGenerator(self._api), TeamGenerator(self._api), - DonationGenerator(self._api) + DonationsGenerator(self._api) ]) From bd3e19de62a5efd50e690450e1c49641d3d8fdbc Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Sun, 29 Oct 2023 23:37:37 +0100 Subject: [PATCH 21/30] feat: Rename generator configuration JSON object key --- README.md | 4 ++-- config.example.json | 2 +- main.py | 12 ++++++------ 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index ec72310..f24057a 100644 --- a/README.md +++ b/README.md @@ -9,13 +9,13 @@ The file `generator.py` provides a list of static file generator classes. Each c The configuration file `config.json` is read which contains the configuration for the API. By specifying the name of the generator in the `generators` array of the configuration, the corresponding generator will be used. The current object of the configuration is passed to the generator. -The following API configuration generates the `contributor` and `release` API for selected repositories: +The following configuration generates static files using the `contributors` and `releases` generator for selected repositories: ```json { "api": [ { - "generators": ["release", "contributor"], + "generators": ["releases", "contributors"], "repositories": ["user/repo"] } ] diff --git a/config.example.json b/config.example.json index 41caae2..0e1876f 100644 --- a/config.example.json +++ b/config.example.json @@ -1,5 +1,5 @@ { - "api": [ + "configs": [ { "generators": [ "release+contributor" diff --git a/main.py b/main.py index e5c5906..6c2e757 100644 --- a/main.py +++ b/main.py @@ -4,13 +4,13 @@ from app.generator import DefaultGeneratorProvider config = load_config() output = config["output"] -apis = config["api"] +configs = config["configs"] -api_provider = DefaultGeneratorProvider() +generator_provider = DefaultGeneratorProvider() -for api in apis: - for generator_name in api["generators"]: - generator = api_provider.get(generator_name) +for config in configs: + for generator_name in config["generators"]: + generator = generator_provider.get(generator_name) if generator is None: continue - generator.generate(api, output) + generator.generate(config, output) From afef7ec59d2bee8cdd93eb3c9f9b3ecf0e97fb71 Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Sun, 29 Oct 2023 23:39:09 +0100 Subject: [PATCH 22/30] fix: Generate correct file name --- app/generator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/generator.py b/app/generator.py index 30d4615..8f5d73f 100644 --- a/app/generator.py +++ b/app/generator.py @@ -134,7 +134,7 @@ class DonationsGenerator(Generator): def generate(self, config, path): donation = config["links"] - donation_path = join(path, f"donation.json") + donation_path = join(path, f"donations.json") write_json(donation, donation_path) From 177e680ff70f234f2ba7b9e32f5b8dbd1651b937 Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Sun, 29 Oct 2023 23:40:33 +0100 Subject: [PATCH 23/30] feat: Update example JSON --- config.example.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/config.example.json b/config.example.json index 0e1876f..7718dd9 100644 --- a/config.example.json +++ b/config.example.json @@ -24,11 +24,11 @@ }, { "generators": [ - "donation" + "donations" ], "links": { - "liberapay": "https://liberapay.com/yourteam", - "github": "https://github.com/sponsors/yourteam" + "Open Collective": "https://opencollective.com/yourteam", + "GitHub": "https://github.com/sponsors/yourteam" } } ], From 36295fec6443c5f444b19cbc8213a4f00e4d7341 Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Sun, 29 Oct 2023 23:43:19 +0100 Subject: [PATCH 24/30] feat: Add `wallets` to donations generator --- app/generator.py | 18 +++++++++++++++--- config.example.json | 4 ++++ 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/app/generator.py b/app/generator.py index 8f5d73f..90d5703 100644 --- a/app/generator.py +++ b/app/generator.py @@ -34,6 +34,7 @@ class ReleasesGenerator(Generator): The release file is named after the tag of the release and contains the latest release information of the repository. A `latest.json` file is also generated containing the latest release of the repository. """ + def __init__(self, api): super().__init__("releases", api) @@ -74,6 +75,7 @@ class ContributorsGenerator(Generator): Generates a contributor file for each repository in the config. The contributor file is named after the repository and contains the contributors of the repository. """ + def __init__(self, api): super().__init__("contributors", api) @@ -96,6 +98,7 @@ class ConnectionsGenerator(Generator): """ Generates a file containing the connections of the organization. """ + def __init__(self, api): super().__init__("connections", api) @@ -111,6 +114,7 @@ class TeamGenerator(Generator): """ Generates a team file containing the members of the organization. """ + def __init__(self, api): super().__init__("team", api) @@ -126,17 +130,25 @@ class TeamGenerator(Generator): class DonationsGenerator(Generator): """ - Generates a donation file containing the donation links of the organization. + Generates a donation file containing ways to donate to the organization. """ + def __init__(self, api): super().__init__("donations", api) def generate(self, config, path): - donation = config["links"] + donation_links = config["links"] + donation_wallets = config["wallets"] donation_path = join(path, f"donations.json") - write_json(donation, donation_path) + write_json( + { + "links": donation_links, + "wallets": donation_wallets + }, + donation_path + ) class GeneratorProvider: diff --git a/config.example.json b/config.example.json index 7718dd9..50d8000 100644 --- a/config.example.json +++ b/config.example.json @@ -29,6 +29,10 @@ "links": { "Open Collective": "https://opencollective.com/yourteam", "GitHub": "https://github.com/sponsors/yourteam" + }, + "wallets": { + "Bitcoin": "bitcoinaddress", + "Ethereum": "ethereumaddress" } } ], From 1e515062d52fb716149c12ac1ab0d2ff6baf8fad Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Sun, 29 Oct 2023 23:44:44 +0100 Subject: [PATCH 25/30] feat: Handle missing keys in generator configs --- app/generator.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/generator.py b/app/generator.py index 90d5703..2bf29f8 100644 --- a/app/generator.py +++ b/app/generator.py @@ -3,7 +3,6 @@ from app import api from app.utils import get_repository_name, to_json, write_json, read_json, create_if_not_exists from abc import abstractmethod - class Generator: _api: api.Api @@ -137,8 +136,8 @@ class DonationsGenerator(Generator): super().__init__("donations", api) def generate(self, config, path): - donation_links = config["links"] - donation_wallets = config["wallets"] + donation_links = config["links"] if "links" in config else [] + donation_wallets = config["wallets"] if "wallets" in config else [] donation_path = join(path, f"donations.json") From 0ce6af1d453ffe69fbc46790a73c4226169beeb3 Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Mon, 30 Oct 2023 00:02:42 +0100 Subject: [PATCH 26/30] feat: Purge files before generating them --- README.md | 3 ++- config.example.json | 5 ++++- main.py | 16 +++++++++++++--- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index f24057a..05b71b0 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,8 @@ The following configuration generates static files using the `contributors` and } ``` -All static files are generated in the output path specified in the configuration. +All static files are generated in the output path specified in the configuration. +The `purge` array in the configuration specifies which files should be deleted before generating the static files. ## Setup diff --git a/config.example.json b/config.example.json index 50d8000..41192e3 100644 --- a/config.example.json +++ b/config.example.json @@ -36,5 +36,8 @@ } } ], - "output": "static" + "output": "static", + "purge": [ + "static" + ] } \ No newline at end of file diff --git a/main.py b/main.py index 6c2e757..ad0d711 100644 --- a/main.py +++ b/main.py @@ -1,14 +1,24 @@ +from genericpath import isdir, isfile +import os +import shutil from app.config import load_config from app.generator import DefaultGeneratorProvider config = load_config() -output = config["output"] -configs = config["configs"] +output = config["output"] if "output" in config else "static" +purge = config["purge"] if "purge" in config else [] +generator_configs = config["configs"] generator_provider = DefaultGeneratorProvider() -for config in configs: +for path in purge: + if isdir(path): + shutil.rmtree(path) + elif isfile(path): + os.remove(path) + +for config in generator_configs: for generator_name in config["generators"]: generator = generator_provider.get(generator_name) if generator is None: From 31812656233da4af63f9f0bb2bada2bbf5107d9f Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Mon, 30 Oct 2023 00:11:11 +0100 Subject: [PATCH 27/30] fix: Use correct generator namein example config --- app/generator.py | 6 +++--- config.example.json | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/generator.py b/app/generator.py index 2bf29f8..d8c7e8a 100644 --- a/app/generator.py +++ b/app/generator.py @@ -102,11 +102,11 @@ class ConnectionsGenerator(Generator): super().__init__("connections", api) def generate(self, config, path): - new_social = config["connections"] + new_connections = config["connections"] - social_path = join(path, f"connections.json") + connections_path = join(path, f"connections.json") - write_json(new_social, social_path) + write_json(new_connections, connections_path) class TeamGenerator(Generator): diff --git a/config.example.json b/config.example.json index 41192e3..1cb7432 100644 --- a/config.example.json +++ b/config.example.json @@ -10,9 +10,9 @@ }, { "generators": [ - "social" + "connections" ], - "socials": { + "connections": { "website": "https://yourwebsite.com" } }, From c0c91db2dfc701757fccd0eacbc63731ab20fec5 Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Mon, 30 Oct 2023 00:14:46 +0100 Subject: [PATCH 28/30] feat: Update example config with real life example --- app/generator.py | 8 ++-- config.example.json | 105 +++++++++++++++++++++++++++++++++++++------- 2 files changed, 92 insertions(+), 21 deletions(-) diff --git a/app/generator.py b/app/generator.py index d8c7e8a..5b718a6 100644 --- a/app/generator.py +++ b/app/generator.py @@ -136,15 +136,15 @@ class DonationsGenerator(Generator): super().__init__("donations", api) def generate(self, config, path): - donation_links = config["links"] if "links" in config else [] - donation_wallets = config["wallets"] if "wallets" in config else [] + links = config["links"] if "links" in config else [] + wallets = config["wallets"] if "wallets" in config else [] donation_path = join(path, f"donations.json") write_json( { - "links": donation_links, - "wallets": donation_wallets + "links": links, + "wallets": wallets }, donation_path ) diff --git a/config.example.json b/config.example.json index 1cb7432..63953cf 100644 --- a/config.example.json +++ b/config.example.json @@ -2,42 +2,113 @@ "configs": [ { "generators": [ - "release+contributor" + "releases", + "contributors" ], "repositories": [ - "user/repo" + "revanced/revanced-patches", + "revanced/revanced-integrations", + "revanced/revanced-manager" ] }, { "generators": [ "connections" ], - "connections": { - "website": "https://yourwebsite.com" - } + "connections": [ + { + "name": "Website", + "url": "https://revanced.app", + "preferred": true + }, + { + "name": "GitHub", + "url": "https://github.com/revanced", + "preferred": false + }, + { + "name": "Twitter", + "url": "https://twitter.com/revancedapp", + "preferred": false + }, + { + "name": "Discord", + "url": "https://revanced.app/discord", + "preferred": true + }, + { + "name": "Reddit", + "url": "https://www.reddit.com/r/revancedapp", + "preferred": false + }, + { + "name": "Telegram", + "url": "https://t.me/app_revanced", + "preferred": false + }, + { + "name": "YouTube", + "url": "https://www.youtube.com/@ReVanced", + "preferred": false + } + ] }, { "generators": [ "team" ], - "organization": "yourorg" + "organization": "revanced" }, { "generators": [ "donations" ], - "links": { - "Open Collective": "https://opencollective.com/yourteam", - "GitHub": "https://github.com/sponsors/yourteam" - }, - "wallets": { - "Bitcoin": "bitcoinaddress", - "Ethereum": "ethereumaddress" - } + "links": [ + { + "name": "Open Collective", + "url": "https://opencollective.com/revanced", + "preferred": true + }, + { + "name": "GitHub Sponsors", + "url": "https://github.com/sponsors/ReVanced", + "preferred": false + } + ], + "wallets": [ + { + "network": "Bitcoin", + "currency_code": "BTC", + "address": "bc1q4x8j6mt27y5gv0q625t8wkr87ruy8fprpy4v3f", + "preferred": false + }, + { + "network": "Dogecoin", + "currency_code": "DOGE", + "address": "D8GH73rNjudgi6bS2krrXWEsU9KShedLXp", + "preferred": true + }, + { + "network": "Ethereum", + "currency_code": "ETH", + "address": "0x7ab4091e00363654bf84B34151225742cd92FCE5", + "preferred": false + }, + { + "network": "Litecoin", + "currency_code": "LTC", + "address": "LbJi8EuoDcwaZvykcKmcrM74jpjde23qJ2", + "preferred": false + }, + { + "network": "Monero", + "currency_code": "XMR", + "address": "46YwWDbZD6jVptuk5mLHsuAmh1BnUMSjSNYacozQQEraWSQ93nb2yYVRHoMR6PmFYWEHsLHg9tr1cH5M8Rtn7YaaGQPCjSh", + "preferred": false + } + ] } ], "output": "static", - "purge": [ - "static" - ] + "purge": [] } \ No newline at end of file From 915db07c72939c10c2c7de92507a7a612070a26c Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Mon, 30 Oct 2023 00:19:59 +0100 Subject: [PATCH 29/30] feat: Commit static files to variable branch --- .github/workflows/update.yml | 14 +++++++++----- README.md | 2 +- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/workflows/update.yml b/.github/workflows/update.yml index ef8143f..81c76ee 100644 --- a/.github/workflows/update.yml +++ b/.github/workflows/update.yml @@ -3,6 +3,10 @@ name: Update static files on: repository_dispatch: workflow_dispatch: + inputs: + output-branch: + descripton: "Branch to push static files to" + required: true jobs: update: @@ -24,7 +28,7 @@ jobs: - name: Check if a deployment exists run: | - if git ls-remote --exit-code --heads origin gh-pages; then + if git ls-remote --exit-code --heads origin ${{ inputs.output-branch }}; then echo "::set-output name=deployment-exists::true" else echo "::set-output name=deployment-exists::false" @@ -36,12 +40,12 @@ jobs: run: | git config user.name revanced-bot git config user.email github@revanced.app - git subtree add --prefix=static/ origin/gh-pages --squash + git subtree add --prefix=static/ origin/${{ inputs.output-branch }} --squash - name: Update static files run: | - pip install requests - python src/main.py + poetry install + poetry run python main.py - name: Commit changes uses: EndBug/add-and-commit@v9 @@ -54,6 +58,6 @@ jobs: uses: s0/git-publish-subdir-action@develop env: REPO: self - BRANCH: gh-pages + BRANCH: ${{ inputs.output-branch }} FOLDER: static GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/README.md b/README.md index 05b71b0..4f95d9c 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Repository to host a static API using GitHub workflows. ## How it works -When CI is ran, static files are generated and commited to the `gh-pages` branch. +When CI is ran, static files are generated and commited to the specified branch. The file `generator.py` provides a list of static file generator classes. Each class has a name. The configuration file `config.json` is read which contains the configuration for the API. By specifying the name of the generator in the `generators` array of the configuration, the corresponding generator will be used. The current object of the configuration is passed to the generator. From 85d60eef0e8b03861ffe5f8203831855254cf9c3 Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Mon, 30 Oct 2023 00:22:55 +0100 Subject: [PATCH 30/30] chore: Remove unnecessary project files --- requirements.txt | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 requirements.txt diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index a87fa7d..0000000 --- a/requirements.txt +++ /dev/null @@ -1,5 +0,0 @@ -certifi==2022.12.7 ; python_version >= "3.11" and python_version < "4" -charset-normalizer==3.1.0 ; python_version >= "3.11" and python_version < "4" -idna==3.4 ; python_version >= "3.11" and python_version < "4" -requests==2.28.2 ; python_version >= "3.11" and python_version < "4" -urllib3==1.26.15 ; python_version >= "3.11" and python_version < "4"