diff --git a/.github/workflows/on-push-to-main.yml b/.github/workflows/on-push-to-main.yml index b5ad724..ffd978c 100644 --- a/.github/workflows/on-push-to-main.yml +++ b/.github/workflows/on-push-to-main.yml @@ -1,42 +1,42 @@ -#name: Release Main -# -#on: -# push: -# branches: -# - main -# -#jobs: -# release: -# name: Release main -# runs-on: ubuntu-latest -# -# steps: -# - name: Checkout -# uses: actions/checkout@v3 -# with: -# fetch-depth: 0 -# ref: main -# -# - name: Setup Node.js -# uses: actions/setup-node@v3 -# with: -# node-version: 'lts/*' -# -# - name: Set up Python 3.9 -# uses: actions/setup-python@v3 -# with: -# python-version: 3.9 -# -# - name: Install python dependencies -# run: | -# python -m pip install --upgrade wheel setuptools pipenv-setup twine -# -# - name: Install semantic release dependencies -# run: npm i semantic-release-slack-bot semantic-release-pypi -# -# - name: Release -# env: -# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} -# SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_NT_SEMANTIC_RELEASE_PROD }} -# PYPI_TOKEN: ${{ secrets.GH_PYPI_TOKEN }} -# run: npx semantic-release +name: Release Main + +on: + push: + branches: + - main + +jobs: + release: + name: Release main + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + ref: main + + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: 'lts/*' + + - name: Set up Python 3.9 + uses: actions/setup-python@v3 + with: + python-version: 3.9 + + - name: Install python dependencies + run: | + python -m pip install --upgrade wheel setuptools pipenv-setup twine + + - name: Install semantic release dependencies + run: npm i semantic-release-slack-bot semantic-release-pypi + + - name: Release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_NT_SEMANTIC_RELEASE_PROD }} + PYPI_TOKEN: ${{ secrets.GH_PYPI_TOKEN }} + run: npx semantic-release diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 394510c..2ed6563 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -9,7 +9,7 @@ repos: pass_filenames: false require_serial: true args: [ - "changeme-package-name-stubs", + "sqlalchemy_utils-stubs", "--show-error-codes", "--namespace-packages", "--show-traceback", @@ -30,7 +30,7 @@ repos: hooks: - id: reorder-python-imports args: [ - "--application-directories=changeme-package-name-stubs" + "--application-directories=sqlalchemy_utils-stubs" ] - repo: https://gitlab.com/pycqa/flake8 rev: 4.0.1 diff --git a/.releaserc b/.releaserc index 204a70e..165cddc 100644 --- a/.releaserc +++ b/.releaserc @@ -12,7 +12,7 @@ { "notifyOnSuccess": false, "notifyOnFail": false, - "packageName": "changeme-types-package-name", + "packageName": "types-sqlalchemy-utils", "branchesConfig": [ { "pattern": "main", diff --git a/Pipfile b/Pipfile index f99ea95..96a8182 100644 --- a/Pipfile +++ b/Pipfile @@ -5,6 +5,8 @@ name = "pypi" # If you edit this file, run `pipenv-setup sync --pipfile --dev` afterwards [dev-packages] +sqlalchemy-utils = "==0.38.2" +sqlalchemy2-stubs = "==0.0.2a21" mypy = "==0.942" pipenv-setup = "==3.2.0" diff --git a/Pipfile.lock b/Pipfile.lock index c03d483..7325851 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "200fa8e5b3bde15bae56abd007b616b96f7d9d171ba0e3634cd8e0659083108e" + "sha256": "7099ff5c02fab59bbb84a4ab85be2ccc00336efe4175cbf9573d5d0e338342f8" }, "pipfile-spec": 6, "requires": { @@ -27,11 +27,11 @@ }, "bleach": { "hashes": [ - "sha256:0900d8b37eba61a802ee40ac0061f8c2b5dee29c1927dd1d233e075ebf5a71da", - "sha256:4d2651ab93271d1129ac9cbc679f524565cc8a1b791909c4a51eac4446a15994" + "sha256:08a1fe86d253b5c88c92cc3d810fd8048a16d15762e1e5b74d502256e5926aa1", + "sha256:c6d6cc054bdc9c83b48b8083e236e5f00f238428666d2ce2e083eaa5fd568565" ], - "markers": "python_version >= '3.6'", - "version": "==4.1.0" + "markers": "python_version >= '3.7'", + "version": "==5.0.0" }, "cached-property": { "hashes": [ @@ -180,6 +180,67 @@ "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'", "version": "==0.18.1" }, + "greenlet": { + "hashes": [ + "sha256:0051c6f1f27cb756ffc0ffbac7d2cd48cb0362ac1736871399a739b2885134d3", + "sha256:00e44c8afdbe5467e4f7b5851be223be68adb4272f44696ee71fe46b7036a711", + "sha256:013d61294b6cd8fe3242932c1c5e36e5d1db2c8afb58606c5a67efce62c1f5fd", + "sha256:049fe7579230e44daef03a259faa24511d10ebfa44f69411d99e6a184fe68073", + "sha256:14d4f3cd4e8b524ae9b8aa567858beed70c392fdec26dbdb0a8a418392e71708", + "sha256:166eac03e48784a6a6e0e5f041cfebb1ab400b394db188c48b3a84737f505b67", + "sha256:17ff94e7a83aa8671a25bf5b59326ec26da379ace2ebc4411d690d80a7fbcf23", + "sha256:1e12bdc622676ce47ae9abbf455c189e442afdde8818d9da983085df6312e7a1", + "sha256:21915eb821a6b3d9d8eefdaf57d6c345b970ad722f856cd71739493ce003ad08", + "sha256:288c6a76705dc54fba69fbcb59904ae4ad768b4c768839b8ca5fdadec6dd8cfd", + "sha256:2bde6792f313f4e918caabc46532aa64aa27a0db05d75b20edfc5c6f46479de2", + "sha256:32ca72bbc673adbcfecb935bb3fb1b74e663d10a4b241aaa2f5a75fe1d1f90aa", + "sha256:356b3576ad078c89a6107caa9c50cc14e98e3a6c4874a37c3e0273e4baf33de8", + "sha256:40b951f601af999a8bf2ce8c71e8aaa4e8c6f78ff8afae7b808aae2dc50d4c40", + "sha256:572e1787d1460da79590bf44304abbc0a2da944ea64ec549188fa84d89bba7ab", + "sha256:58df5c2a0e293bf665a51f8a100d3e9956febfbf1d9aaf8c0677cf70218910c6", + "sha256:64e6175c2e53195278d7388c454e0b30997573f3f4bd63697f88d855f7a6a1fc", + "sha256:7227b47e73dedaa513cdebb98469705ef0d66eb5a1250144468e9c3097d6b59b", + "sha256:7418b6bfc7fe3331541b84bb2141c9baf1ec7132a7ecd9f375912eca810e714e", + "sha256:7cbd7574ce8e138bda9df4efc6bf2ab8572c9aff640d8ecfece1b006b68da963", + "sha256:7ff61ff178250f9bb3cd89752df0f1dd0e27316a8bd1465351652b1b4a4cdfd3", + "sha256:833e1551925ed51e6b44c800e71e77dacd7e49181fdc9ac9a0bf3714d515785d", + "sha256:8639cadfda96737427330a094476d4c7a56ac03de7265622fcf4cfe57c8ae18d", + "sha256:8c5d5b35f789a030ebb95bff352f1d27a93d81069f2adb3182d99882e095cefe", + "sha256:8c790abda465726cfb8bb08bd4ca9a5d0a7bd77c7ac1ca1b839ad823b948ea28", + "sha256:8d2f1fb53a421b410751887eb4ff21386d119ef9cde3797bf5e7ed49fb51a3b3", + "sha256:903bbd302a2378f984aef528f76d4c9b1748f318fe1294961c072bdc7f2ffa3e", + "sha256:93f81b134a165cc17123626ab8da2e30c0455441d4ab5576eed73a64c025b25c", + "sha256:95e69877983ea39b7303570fa6760f81a3eec23d0e3ab2021b7144b94d06202d", + "sha256:9633b3034d3d901f0a46b7939f8c4d64427dfba6bbc5a36b1a67364cf148a1b0", + "sha256:97e5306482182170ade15c4b0d8386ded995a07d7cc2ca8f27958d34d6736497", + "sha256:9f3cba480d3deb69f6ee2c1825060177a22c7826431458c697df88e6aeb3caee", + "sha256:aa5b467f15e78b82257319aebc78dd2915e4c1436c3c0d1ad6f53e47ba6e2713", + "sha256:abb7a75ed8b968f3061327c433a0fbd17b729947b400747c334a9c29a9af6c58", + "sha256:aec52725173bd3a7b56fe91bc56eccb26fbdff1386ef123abb63c84c5b43b63a", + "sha256:b11548073a2213d950c3f671aa88e6f83cda6e2fb97a8b6317b1b5b33d850e06", + "sha256:b1692f7d6bc45e3200844be0dba153612103db241691088626a33ff1f24a0d88", + "sha256:b336501a05e13b616ef81ce329c0e09ac5ed8c732d9ba7e3e983fcc1a9e86965", + "sha256:b8c008de9d0daba7b6666aa5bbfdc23dcd78cafc33997c9b7741ff6353bafb7f", + "sha256:b92e29e58bef6d9cfd340c72b04d74c4b4e9f70c9fa7c78b674d1fec18896dc4", + "sha256:be5f425ff1f5f4b3c1e33ad64ab994eed12fc284a6ea71c5243fd564502ecbe5", + "sha256:dd0b1e9e891f69e7675ba5c92e28b90eaa045f6ab134ffe70b52e948aa175b3c", + "sha256:e30f5ea4ae2346e62cedde8794a56858a67b878dd79f7df76a0767e356b1744a", + "sha256:e6a36bb9474218c7a5b27ae476035497a6990e21d04c279884eb10d9b290f1b1", + "sha256:e859fcb4cbe93504ea18008d1df98dee4f7766db66c435e4882ab35cf70cac43", + "sha256:eb6ea6da4c787111adf40f697b4e58732ee0942b5d3bd8f435277643329ba627", + "sha256:ec8c433b3ab0419100bd45b47c9c8551248a5aee30ca5e9d399a0b57ac04651b", + "sha256:eff9d20417ff9dcb0d25e2defc2574d10b491bf2e693b4e491914738b7908168", + "sha256:f0214eb2a23b85528310dad848ad2ac58e735612929c8072f6093f3585fd342d", + "sha256:f276df9830dba7a333544bd41070e8175762a7ac20350786b322b714b0e654f5", + "sha256:f3acda1924472472ddd60c29e5b9db0cec629fbe3c5c5accb74d6d6d14773478", + "sha256:f70a9e237bb792c7cc7e44c531fd48f5897961701cdaa06cf22fc14965c496cf", + "sha256:f9d29ca8a77117315101425ec7ec2a47a22ccf59f5593378fc4077ac5b754fce", + "sha256:fa877ca7f6b48054f847b61d6fa7bed5cebb663ebc55e018fda12db09dcc664c", + "sha256:fdcec0b8399108577ec290f55551d926d9a1fa6cad45882093a7a07ac5ec147b" + ], + "markers": "python_version >= '3' and platform_machine == 'aarch64' or (platform_machine == 'ppc64le' or (platform_machine == 'x86_64' or (platform_machine == 'amd64' or (platform_machine == 'AMD64' or (platform_machine == 'win32' or platform_machine == 'WIN32')))))", + "version": "==1.1.2" + }, "idna": { "hashes": [ "sha256:84d9dd047ffa80596e0f246e2eab0b391788b0503584e8945f2368256d2735ff", @@ -343,11 +404,11 @@ }, "pyparsing": { "hashes": [ - "sha256:18ee9022775d270c55187733956460083db60b37d0d0fb357445f3094eed3eea", - "sha256:a6c06a88f252e6c322f65faf8f418b16213b51bdfaece0524c1c1bc30c63c484" + "sha256:7bf433498c016c4314268d95df76c81b842a4cb2b276fa3312cfb1e1d85f6954", + "sha256:ef7b523f6356f763771559412c0d7134753f037822dad1b16945b7b846f7ad06" ], - "markers": "python_version >= '3.6'", - "version": "==3.0.7" + "markers": "python_full_version >= '3.6.8'", + "version": "==3.0.8" }, "python-dateutil": { "hashes": [ @@ -398,11 +459,11 @@ }, "rich": { "hashes": [ - "sha256:198ae15807a7c1bf84ceabf662e902731bf8f874f9e775e2289cab02bb6a4e30", - "sha256:b60ff99f4ff7e3d1d37444dee2b22fdd941c622dbc37841823ec1ce7f058b263" + "sha256:c50f3d253bc6a9bb9c79d61a26d510d74abdf1b16881260fab5edfc3edfb082f", + "sha256:ea74bc9dad9589d8eea3e3fd0b136d8bf6e428888955f215824c2894f0da8b47" ], - "markers": "python_full_version >= '3.6.2' and python_full_version < '4.0.0'", - "version": "==12.1.0" + "markers": "python_version < '4' and python_full_version >= '3.6.3'", + "version": "==12.2.0" }, "secretstorage": { "hashes": [ @@ -414,11 +475,11 @@ }, "setuptools": { "hashes": [ - "sha256:41aface2e85b517c3a466b4689b8055c02cd2e623461f09af7d93f3da65c4709", - "sha256:88fafba4abc2f047e08a188fd4bbc10b0e464592c37b514c19f8f8f88d94450b" + "sha256:26ead7d1f93efc0f8c804d9fafafbe4a44b179580a7105754b245155f9af05a8", + "sha256:47c7b0c0f8fc10eec4cf1e71c6fdadf8decaa74ffa087e68cd1c20db7ad6a592" ], "markers": "python_version >= '3.7'", - "version": "==61.3.1" + "version": "==62.1.0" }, "six": { "hashes": [ @@ -428,6 +489,64 @@ "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", "version": "==1.16.0" }, + "sqlalchemy": { + "hashes": [ + "sha256:093b3109c2747d5dc0fa4314b1caf4c7ca336d5c8c831e3cfbec06a7e861e1e6", + "sha256:186cb3bd77abf2ddcf722f755659559bfb157647b3fd3f32ea1c70e8311e8f6b", + "sha256:1b4eac3933c335d7f375639885765722534bb4e52e51cdc01a667eea822af9b6", + "sha256:1ff9f84b2098ef1b96255a80981ee10f4b5d49b6cfeeccf9632c2078cd86052e", + "sha256:28aa2ef06c904729620cc735262192e622db9136c26d8587f71f29ec7715628a", + "sha256:28b17ebbaee6587013be2f78dc4f6e95115e1ec8dd7647c4e7be048da749e48b", + "sha256:2c6c411d8c59afba95abccd2b418f30ade674186660a2d310d364843049fb2c1", + "sha256:2ffc813b01dc6473990f5e575f210ca5ac2f5465ace3908b78ffd6d20058aab5", + "sha256:48036698f20080462e981b18d77d574631a3d1fc2c33b416c6df299ec1d10b99", + "sha256:48f0eb5bcc87a9b2a95b345ed18d6400daaa86ca414f6840961ed85c342af8f4", + "sha256:4ba2c1f368bcf8551cdaa27eac525022471015633d5bdafbc4297e0511f62f51", + "sha256:53c7469b86a60fe2babca4f70111357e6e3d5150373bc85eb3b914356983e89a", + "sha256:6204d06bfa85f87625e1831ca663f9dba91ac8aec24b8c65d02fb25cbaf4b4d7", + "sha256:63c82c9e8ccc2fb4bfd87c24ffbac320f70b7c93b78f206c1f9c441fa3013a5f", + "sha256:70e571ae9ee0ff36ed37e2b2765445d54981e4d600eccdf6fe3838bc2538d157", + "sha256:95411abc0e36d18f54fa5e24d42960ea3f144fb16caaa5a8c2e492b5424cc82c", + "sha256:9837133b89ad017e50a02a3b46419869cf4e9aa02743e911b2a9e25fa6b05403", + "sha256:9bec63b1e20ef69484f530fb4b4837e050450637ff9acd6dccc7003c5013abf8", + "sha256:9d8edfb09ed2b865485530c13e269833dab62ab2d582fde21026c9039d4d0e62", + "sha256:9dac1924611698f8fe5b2e58601156c01da2b6c0758ba519003013a78280cf4d", + "sha256:9e1a72197529ea00357640f21d92ffc7024e156ef9ac36edf271c8335facbc1a", + "sha256:9e7094cf04e6042c4210a185fa7b9b8b3b789dd6d1de7b4f19452290838e48bd", + "sha256:a4efb70a62cbbbc052c67dc66b5448b0053b509732184af3e7859d05fdf6223c", + "sha256:a5dbdbb39c1b100df4d182c78949158073ca46ba2850c64fe02ffb1eb5b70903", + "sha256:aeea6ace30603ca9a8869853bb4a04c7446856d7789e36694cd887967b7621f6", + "sha256:b2489e70bfa2356f2d421106794507daccf6cc8711753c442fc97272437fc606", + "sha256:babd63fb7cb6b0440abb6d16aca2be63342a6eea3dc7b613bb7a9357dc36920f", + "sha256:c6fb6b9ed1d0be7fa2c90be8ad2442c14cbf84eb0709dd1afeeff1e511550041", + "sha256:cfd8e4c64c30a5219032e64404d468c425bdbc13b397da906fc9bee6591fc0dd", + "sha256:d17316100fcd0b6371ac9211351cb976fd0c2e12a859c1a57965e3ef7f3ed2bc", + "sha256:d38a49aa75a5759d0d118e26701d70c70a37b896379115f8386e91b0444bfa70", + "sha256:da25e75ba9f3fabc271673b6b413ca234994e6d3453424bea36bb5549c5bbaec", + "sha256:e255a8dd5572b0c66d6ee53597d36157ad6cf3bc1114f61c54a65189f996ab03", + "sha256:e8b09e2d90267717d850f2e2323919ea32004f55c40e5d53b41267e382446044", + "sha256:ecc81336b46e31ae9c9bdfa220082079914e31a476d088d3337ecf531d861228", + "sha256:effadcda9a129cc56408dd5b2ea20ee9edcea24bd58e6a1489fa27672d733182" + ], + "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4, 3.5'", + "version": "==1.4.35" + }, + "sqlalchemy-utils": { + "hashes": [ + "sha256:622235b1598f97300e4d08820ab024f5219c9a6309937a8b908093f487b4ba54", + "sha256:9e01d6d3fb52d3926fcd4ea4a13f3540701b751aced0316bff78264402c2ceb4" + ], + "index": "pypi", + "version": "==0.38.2" + }, + "sqlalchemy2-stubs": { + "hashes": [ + "sha256:207e3d8a36fc032d325f4eec89e0c6760efe81d07e978513d8c9b14f108dcd0c", + "sha256:bd4a3d5ca7ff9d01b2245e1b26304d6b2ec4daf43a01faf40db9e09245679433" + ], + "index": "pypi", + "version": "==0.0.2a21" + }, "toml": { "hashes": [ "sha256:806143ae5bfb6a3c6e736a764057db0e6a0e05e338b5630894a5f779cabb4f9b", @@ -449,7 +568,7 @@ "sha256:3c517894eadef53e9072d343d37e4427b8f0b6200a70b7c9a19b2ebd1f53b951", "sha256:3eba517439dcb2f84cf39f4f85fd2c3398309823a3c75ac3e73003638daf7915" ], - "markers": "python_version >= '3.6' and python_full_version < '4.0.0'", + "markers": "python_version >= '3.6' and python_version < '4'", "version": "==0.10.1" }, "twine": { @@ -473,7 +592,7 @@ "sha256:44ece4d53fb1706f667c9bd1c648f5469a2ec925fcf3a776667042d645472c14", "sha256:aabaf16477806a5e1dd19aa41f8c2b7950dd3c746362d7e3223dbe6de6ac448e" ], - "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4' and python_full_version < '4.0.0'", + "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4' and python_version < '4'", "version": "==1.26.9" }, "vistir": { diff --git a/README.md b/README.md index 89ec09f..6c68192 100644 --- a/README.md +++ b/README.md @@ -1,70 +1,23 @@ -# template-python-types - -###(For the instructions below, the original packagename will be assumed to be `foo-bar`. Adapt this to your use case) - -Step-by-step instructions on using this template: - -- Create a new repository using this template. Name it `types-foo-bar`. - - Set up anything that may not carry over from the template (branch permissions, enabling the renovate bot, etc) - - You can use [this](https://app.gitbook.com/o/kE0i1aiE1u2yiaP5k3xM/s/B8iaOECpmPzLCKc8nF0p/development/github-repository-init-checklist) for a full list (although some steps do not apply, like the `next` branch or the `unit-tests` action) - - Set the repository to `public` access. Take a second to think through the implications of this. Extra care will be needed to avoid leaking any information -- Replace all instances of `changeme` strings as follows: - - Replace these: - - `changeme-package-name` => `foo-bar` (name of the original package) - - `changeme-types-package-name` => `types-foo-bar` (name of your stubs package; **must** start with `types-`) - - `changeme-package-name-stubs` => `foo-bar-stubs` (name of the stubs root folder; **must** end with `-stubs`) - - In the following files: - - `README.md` - - `.releaserc` - - `.pre-commit-config.yaml` - - `setup.py` -- Rename the folder `changeme-package-name-stubs` to `foo-bar-stubs`. This will be the root folder for all the stub files -- In `foo-bar-stubs/METADATA.toml`, change the version from `"X.Y.*"` to the version of the original package for which your stubs are meant for (usually the latest one) -- Update the package's information in `setup.py` - - Add/Update the [classifiers](https://pypi.org/classifiers/) to help people find the package - - Add some keywords (like the original package name, related frameworks, etc) to help people find the package - - Change the versions in `python_requires` if necessary. Make sure it matches the versions listed in the classifiers -- Add the dependencies: - - Add your dependencies to the `Pipfile` with an exact version - - Run `$ pipenv install -d` to update the `Pipfile.lock` - - Run `$ pipenv shell` to switch to a shell within the virtual environment - - Run `$ pipenv-setup sync --pipfile --dev` to sync the dependencies to the `setup.py` -- Install the pre-commit hook (see below, in the `Developing` section) -- Add your stubs - - [Optional] Mark the `foo-bar-stubs` directory as `Sources Root` and the `.mypy_cache` directory as `Excluded` - - The stubs can be generated with [stubgen](https://mypy.readthedocs.io/en/stable/stubgen.html#stubgen) with the command `$ stubgen -p foo-bar`, and will only need to be filled in - - The files need to use the root of the `foo-bar-stubs` as their root, and only have sub-folders as necessary to match the structure of the original package -- Test your stubs - - If you add the stubs root directory (`foo-bar-stubs`) to `mypy`'s path, it should pick up and use your stubs automatically. You can tell this is the case when it gives off a warning about the `type: ignore[import]` comment for that specific package being unused (doesn't complain about the package not having stubs available) -- Uncomment the action in `.github/workflows/on-push-to-main.yml` to allow the package to be released -- Remove these instructions from `README.md` (they will still be available in the template repo for the next steps) -- A search through the whole project (CTRL + Shift + F in PyCharm) should find no results for `changeme` -- Release the package - - Merge your changes into the `main` branch (preferably via PR) - - Wait for the GH Action to run, and the package to be released - - The package should be available at https://pypi.org/project/types-foo-bar/ - - Download your package and test it again as a final check - -# changeme-types-package-name +# types-sqlalchemy-utils This is a package containing type annotations -for [changeme-package-name](https://pypi.org/project/changeme-package-name/). +for [sqlalchemy-utils](https://pypi.org/project/sqlalchemy-utils/). ### Installing: Simply run the following in the environment in which you want to install this package: ```shell -# install changeme-types-package-name -$ python -m pip install changeme-types-package-name +# install types-sqlalchemy-utils +$ python -m pip install types-sqlalchemy-utils ``` or add it to your requirements file. ### Developing -This is a partial stub package, only covering a part of the functions and objects available in `changeme-package-name`. -Contributions (both in adding stubs for more functions, or keeping up to date with `changeme-package-name` itself) are +This is a partial stub package, only covering a part of the functions and objects available in `sqlalchemy-utils`. +Contributions (both in adding stubs for more functions, or keeping up to date with `sqlalchemy-utils` itself) are welcome. All the formatting is done using [pre-commit](https://pre-commit.com/). To use this, run the following: diff --git a/changeme-package-name-stubs/METADATA.toml b/changeme-package-name-stubs/METADATA.toml deleted file mode 100644 index 67b5606..0000000 --- a/changeme-package-name-stubs/METADATA.toml +++ /dev/null @@ -1 +0,0 @@ -version = "X.Y.*" diff --git a/setup.py b/setup.py index 4e8e2e1..3076f8a 100644 --- a/setup.py +++ b/setup.py @@ -18,11 +18,11 @@ long_description = f.read() setup( - name="changeme-types-package-name", - description="Type Stubs for changeme-package-name", + name="types-sqlalchemy-utils", + description="Type Stubs for sqlalchemy-utils", long_description=long_description, long_description_content_type="text/markdown", - url="https://github.com/cex-solutions/changeme-package-name", + url="https://github.com/cex-solutions/sqlalchemy-utils", author="Binovate Labs", author_email="cex-dev@binovate.com", classifiers=[ @@ -37,20 +37,28 @@ "Programming Language :: Python :: 3.10", ], license="GPLv3", - keywords="stubs", + keywords="stubs sqlalchemy sqlalchemy-utils", package_data={ - "changeme-package-name-stubs": [ - item.split("changeme-package-name-stubs/")[-1] for item in glob.glob("**/*.pyi", recursive=True) + "sqlalchemy_utils-stubs": [ + item.split("sqlalchemy_utils-stubs/")[-1] for item in glob.glob("**/*.pyi", recursive=True) ] + ["METADATA.toml"] }, - packages=["changeme-package-name-stubs"], + packages=["sqlalchemy_utils-stubs"], python_requires=">=3.7, <4", install_requires=[], - extras_require={"dev": ["mypy==0.942", "pipenv-setup==3.2.0", "twine==4.0.0"]}, + extras_require={ + "dev": [ + "sqlalchemy-utils==0.38.2", + "sqlalchemy2-stubs==0.0.2a21", + "mypy==0.942", + "pipenv-setup==3.2.0", + "twine==4.0.0", + ] + }, dependency_links=[], project_urls={ - "Bug Reports": "https://github.com/cex-solutions/changeme-types-package-name/issues", - "Source": "https://github.com/cex-solutions/changeme-types-package-name", + "Bug Reports": "https://github.com/cex-solutions/types-sqlalchemy-utils/issues", + "Source": "https://github.com/cex-solutions/types-sqlalchemy-utils", }, ) diff --git a/sqlalchemy_utils-stubs/METADATA.toml b/sqlalchemy_utils-stubs/METADATA.toml new file mode 100644 index 0000000..ab03070 --- /dev/null +++ b/sqlalchemy_utils-stubs/METADATA.toml @@ -0,0 +1 @@ +version = "0.38.*" diff --git a/sqlalchemy_utils-stubs/__init__.pyi b/sqlalchemy_utils-stubs/__init__.pyi new file mode 100644 index 0000000..82842c5 --- /dev/null +++ b/sqlalchemy_utils-stubs/__init__.pyi @@ -0,0 +1,108 @@ +from .aggregates import aggregated as aggregated +from .asserts import ( + assert_max_length as assert_max_length, + assert_max_value as assert_max_value, + assert_min_value as assert_min_value, + assert_non_nullable as assert_non_nullable, + assert_nullable as assert_nullable, +) +from .exceptions import ImproperlyConfigured as ImproperlyConfigured +from .expressions import Asterisk as Asterisk, row_to_json as row_to_json +from .functions import ( + cast_if as cast_if, + create_database as create_database, + create_mock_engine as create_mock_engine, + database_exists as database_exists, + dependent_objects as dependent_objects, + drop_database as drop_database, + escape_like as escape_like, + get_bind as get_bind, + get_class_by_table as get_class_by_table, + get_column_key as get_column_key, + get_columns as get_columns, + get_declarative_base as get_declarative_base, + get_fk_constraint_for_columns as get_fk_constraint_for_columns, + get_hybrid_properties as get_hybrid_properties, + get_mapper as get_mapper, + get_primary_keys as get_primary_keys, + get_referencing_foreign_keys as get_referencing_foreign_keys, + get_tables as get_tables, + get_type as get_type, + group_foreign_keys as group_foreign_keys, + has_changes as has_changes, + has_index as has_index, + has_unique_index as has_unique_index, + identity as identity, + is_loaded as is_loaded, + json_sql as json_sql, + jsonb_sql as jsonb_sql, + merge_references as merge_references, + mock_engine as mock_engine, + naturally_equivalent as naturally_equivalent, + render_expression as render_expression, + render_statement as render_statement, + table_name as table_name, +) +from .generic import generic_relationship as generic_relationship +from .i18n import TranslationHybrid as TranslationHybrid +from .listeners import ( + auto_delete_orphans as auto_delete_orphans, + coercion_listener as coercion_listener, + force_auto_coercion as force_auto_coercion, + force_instant_defaults as force_instant_defaults, +) +from .models import Timestamp as Timestamp, generic_repr as generic_repr +from .observer import observes as observes +from .primitives import ( + Country as Country, + Currency as Currency, + Ltree as Ltree, + WeekDay as WeekDay, + WeekDays as WeekDays, +) +from .proxy_dict import ProxyDict as ProxyDict, proxy_dict as proxy_dict +from .query_chain import QueryChain as QueryChain +from .types import ( + ArrowType as ArrowType, + Choice as Choice, + ChoiceType as ChoiceType, + ColorType as ColorType, + CompositeType as CompositeType, + CountryType as CountryType, + CurrencyType as CurrencyType, + DateRangeType as DateRangeType, + DateTimeRangeType as DateTimeRangeType, + EmailType as EmailType, + EncryptedType as EncryptedType, + EnrichedDateTimeType as EnrichedDateTimeType, + EnrichedDateType as EnrichedDateType, + IPAddressType as IPAddressType, + InstrumentedList as InstrumentedList, + Int8RangeType as Int8RangeType, + IntRangeType as IntRangeType, + JSONType as JSONType, + LocaleType as LocaleType, + LtreeType as LtreeType, + NumericRangeType as NumericRangeType, + Password as Password, + PasswordType as PasswordType, + PhoneNumber as PhoneNumber, + PhoneNumberParseException as PhoneNumberParseException, + PhoneNumberType as PhoneNumberType, + ScalarListException as ScalarListException, + ScalarListType as ScalarListType, + StringEncryptedType as StringEncryptedType, + TSVectorType as TSVectorType, + TimezoneType as TimezoneType, + URLType as URLType, + UUIDType as UUIDType, + WeekDaysType as WeekDaysType, + instrumented_list as instrumented_list, + register_composites as register_composites, + remove_composite_listeners as remove_composite_listeners, +) +from .view import ( + create_materialized_view as create_materialized_view, + create_view as create_view, + refresh_materialized_view as refresh_materialized_view, +) diff --git a/sqlalchemy_utils-stubs/aggregates.pyi b/sqlalchemy_utils-stubs/aggregates.pyi new file mode 100644 index 0000000..397ac18 --- /dev/null +++ b/sqlalchemy_utils-stubs/aggregates.pyi @@ -0,0 +1,10 @@ +from .compat import get_scalar_subquery as get_scalar_subquery +from .functions.orm import get_column_key as get_column_key +from .relationships import ( + chained_join as chained_join, + path_to_relationships as path_to_relationships, + select_correlated_expression as select_correlated_expression, +) +from typing import Any + +def __getattr__(name: str) -> Any: ... # incomplete diff --git a/sqlalchemy_utils-stubs/asserts.pyi b/sqlalchemy_utils-stubs/asserts.pyi new file mode 100644 index 0000000..964e6fa --- /dev/null +++ b/sqlalchemy_utils-stubs/asserts.pyi @@ -0,0 +1,3 @@ +from typing import Any + +def __getattr__(name: str) -> Any: ... # incomplete diff --git a/sqlalchemy_utils-stubs/batch.pyi b/sqlalchemy_utils-stubs/batch.pyi new file mode 100644 index 0000000..0d3a753 --- /dev/null +++ b/sqlalchemy_utils-stubs/batch.pyi @@ -0,0 +1,12 @@ +from sqlalchemy_utils.functions.orm import ( + list_local_remote_exprs as list_local_remote_exprs, + list_local_values as list_local_values, + local_values as local_values, + remote as remote, + remote_column_names as remote_column_names, + remote_values as remote_values, +) +from sqlalchemy_utils.generic import GenericRelationshipProperty as GenericRelationshipProperty +from typing import Any + +def __getattr__(name: str) -> Any: ... # incomplete diff --git a/sqlalchemy_utils-stubs/compat.pyi b/sqlalchemy_utils-stubs/compat.pyi new file mode 100644 index 0000000..964e6fa --- /dev/null +++ b/sqlalchemy_utils-stubs/compat.pyi @@ -0,0 +1,3 @@ +from typing import Any + +def __getattr__(name: str) -> Any: ... # incomplete diff --git a/sqlalchemy_utils-stubs/decorators.pyi b/sqlalchemy_utils-stubs/decorators.pyi new file mode 100644 index 0000000..4ee044b --- /dev/null +++ b/sqlalchemy_utils-stubs/decorators.pyi @@ -0,0 +1,5 @@ +from .functions import getdotattr as getdotattr +from .path import AttrPath as AttrPath +from typing import Any + +def __getattr__(name: str) -> Any: ... # incomplete diff --git a/sqlalchemy_utils-stubs/exceptions.pyi b/sqlalchemy_utils-stubs/exceptions.pyi new file mode 100644 index 0000000..608c0b4 --- /dev/null +++ b/sqlalchemy_utils-stubs/exceptions.pyi @@ -0,0 +1 @@ +class ImproperlyConfigured(Exception): ... diff --git a/sqlalchemy_utils-stubs/expression_parser.pyi b/sqlalchemy_utils-stubs/expression_parser.pyi new file mode 100644 index 0000000..964e6fa --- /dev/null +++ b/sqlalchemy_utils-stubs/expression_parser.pyi @@ -0,0 +1,3 @@ +from typing import Any + +def __getattr__(name: str) -> Any: ... # incomplete diff --git a/sqlalchemy_utils-stubs/expressions.pyi b/sqlalchemy_utils-stubs/expressions.pyi new file mode 100644 index 0000000..688eabc --- /dev/null +++ b/sqlalchemy_utils-stubs/expressions.pyi @@ -0,0 +1,4 @@ +from .functions.orm import quote as quote +from typing import Any + +def __getattr__(name: str) -> Any: ... # incomplete diff --git a/sqlalchemy_utils-stubs/functions/__init__.pyi b/sqlalchemy_utils-stubs/functions/__init__.pyi new file mode 100644 index 0000000..325b8d5 --- /dev/null +++ b/sqlalchemy_utils-stubs/functions/__init__.pyi @@ -0,0 +1,42 @@ +from .database import ( + create_database as create_database, + database_exists as database_exists, + drop_database as drop_database, + escape_like as escape_like, + has_index as has_index, + has_unique_index as has_unique_index, + is_auto_assigned_date_column as is_auto_assigned_date_column, + json_sql as json_sql, + jsonb_sql as jsonb_sql, +) +from .foreign_keys import ( + dependent_objects as dependent_objects, + get_fk_constraint_for_columns as get_fk_constraint_for_columns, + get_referencing_foreign_keys as get_referencing_foreign_keys, + group_foreign_keys as group_foreign_keys, + merge_references as merge_references, + non_indexed_foreign_keys as non_indexed_foreign_keys, +) +from .mock import create_mock_engine as create_mock_engine, mock_engine as mock_engine +from .orm import ( + cast_if as cast_if, + get_bind as get_bind, + get_class_by_table as get_class_by_table, + get_column_key as get_column_key, + get_columns as get_columns, + get_declarative_base as get_declarative_base, + get_hybrid_properties as get_hybrid_properties, + get_mapper as get_mapper, + get_primary_keys as get_primary_keys, + get_tables as get_tables, + get_type as get_type, + getdotattr as getdotattr, + has_changes as has_changes, + identity as identity, + is_loaded as is_loaded, + naturally_equivalent as naturally_equivalent, + quote as quote, + table_name as table_name, +) +from .render import render_expression as render_expression, render_statement as render_statement +from .sort_query import make_order_by_deterministic as make_order_by_deterministic diff --git a/sqlalchemy_utils-stubs/functions/database.pyi b/sqlalchemy_utils-stubs/functions/database.pyi new file mode 100644 index 0000000..54ab7c0 --- /dev/null +++ b/sqlalchemy_utils-stubs/functions/database.pyi @@ -0,0 +1,24 @@ +from collections.abc import Mapping, Sequence + +from sqlalchemy import Column, ForeignKeyConstraint +from sqlalchemy.engine import URL +from sqlalchemy.sql.functions import Function +from typing_extensions import TypeAlias + +from ..utils import starts_with as starts_with +from .orm import quote as quote +from typing import Union, Optional, Any + +# Should be `_VT: TypeAlias = Union[int, float, str, Mapping[str, "_VT"], Sequence["_VT"]]` +# But recursive types are not yet fully supported by mypy. See https://github.com/python/mypy/issues/731 +_VT: TypeAlias = Union[int, float, str, Mapping[str, Any], Sequence[Any]] + +def escape_like(string: str, escape_char: str = ...) -> str: ... +def json_sql(value: _VT, scalars_to_json: bool = ...) -> Function[Any]: ... +def jsonb_sql(value: _VT, scalars_to_jsonb: bool = ...) -> Function[Any]: ... +def has_index(column_or_constraint: Union[Column[Any], ForeignKeyConstraint]) -> bool: ... +def has_unique_index(column_or_constraint: Union[Column[Any], ForeignKeyConstraint]) -> bool: ... +def is_auto_assigned_date_column(column: Column[Any]) -> bool: ... +def database_exists(url: Union[URL, str]) -> bool: ... +def create_database(url: Union[URL, str], encoding: str = ..., template: Optional[str] = ...) -> None: ... +def drop_database(url: Union[URL, str]) -> None: ... diff --git a/sqlalchemy_utils-stubs/functions/defer_except.pyi b/sqlalchemy_utils-stubs/functions/defer_except.pyi new file mode 100644 index 0000000..964e6fa --- /dev/null +++ b/sqlalchemy_utils-stubs/functions/defer_except.pyi @@ -0,0 +1,3 @@ +from typing import Any + +def __getattr__(name: str) -> Any: ... # incomplete diff --git a/sqlalchemy_utils-stubs/functions/foreign_keys.pyi b/sqlalchemy_utils-stubs/functions/foreign_keys.pyi new file mode 100644 index 0000000..8fb0df6 --- /dev/null +++ b/sqlalchemy_utils-stubs/functions/foreign_keys.pyi @@ -0,0 +1,6 @@ +from ..query_chain import QueryChain as QueryChain +from .database import has_index as has_index +from .orm import get_column_key as get_column_key, get_mapper as get_mapper, get_tables as get_tables +from typing import Any + +def __getattr__(name: str) -> Any: ... # incomplete diff --git a/sqlalchemy_utils-stubs/functions/mock.pyi b/sqlalchemy_utils-stubs/functions/mock.pyi new file mode 100644 index 0000000..964e6fa --- /dev/null +++ b/sqlalchemy_utils-stubs/functions/mock.pyi @@ -0,0 +1,3 @@ +from typing import Any + +def __getattr__(name: str) -> Any: ... # incomplete diff --git a/sqlalchemy_utils-stubs/functions/orm.pyi b/sqlalchemy_utils-stubs/functions/orm.pyi new file mode 100644 index 0000000..1d66f3d --- /dev/null +++ b/sqlalchemy_utils-stubs/functions/orm.pyi @@ -0,0 +1,4 @@ +from ..utils import is_sequence as is_sequence +from typing import Any + +def __getattr__(name: str) -> Any: ... # incomplete diff --git a/sqlalchemy_utils-stubs/functions/render.pyi b/sqlalchemy_utils-stubs/functions/render.pyi new file mode 100644 index 0000000..0534cc1 --- /dev/null +++ b/sqlalchemy_utils-stubs/functions/render.pyi @@ -0,0 +1,4 @@ +from .mock import create_mock_engine as create_mock_engine +from typing import Any + +def __getattr__(name: str) -> Any: ... # incomplete diff --git a/sqlalchemy_utils-stubs/functions/sort_query.pyi b/sqlalchemy_utils-stubs/functions/sort_query.pyi new file mode 100644 index 0000000..a9cf8b9 --- /dev/null +++ b/sqlalchemy_utils-stubs/functions/sort_query.pyi @@ -0,0 +1,6 @@ +from typing import Any + +from .database import has_unique_index as has_unique_index +from .orm import get_tables as get_tables + +def __getattr__(name: str) -> Any: ... # incomplete diff --git a/sqlalchemy_utils-stubs/generic.pyi b/sqlalchemy_utils-stubs/generic.pyi new file mode 100644 index 0000000..24b9992 --- /dev/null +++ b/sqlalchemy_utils-stubs/generic.pyi @@ -0,0 +1,5 @@ +from .exceptions import ImproperlyConfigured as ImproperlyConfigured +from .functions import identity as identity +from typing import Any + +def __getattr__(name: str) -> Any: ... # incomplete diff --git a/sqlalchemy_utils-stubs/i18n.pyi b/sqlalchemy_utils-stubs/i18n.pyi new file mode 100644 index 0000000..1e8e40c --- /dev/null +++ b/sqlalchemy_utils-stubs/i18n.pyi @@ -0,0 +1,4 @@ +from .exceptions import ImproperlyConfigured as ImproperlyConfigured +from typing import Any + +def __getattr__(name: str) -> Any: ... # incomplete diff --git a/sqlalchemy_utils-stubs/listeners.pyi b/sqlalchemy_utils-stubs/listeners.pyi new file mode 100644 index 0000000..1e8e40c --- /dev/null +++ b/sqlalchemy_utils-stubs/listeners.pyi @@ -0,0 +1,4 @@ +from .exceptions import ImproperlyConfigured as ImproperlyConfigured +from typing import Any + +def __getattr__(name: str) -> Any: ... # incomplete diff --git a/sqlalchemy_utils-stubs/models.pyi b/sqlalchemy_utils-stubs/models.pyi new file mode 100644 index 0000000..964e6fa --- /dev/null +++ b/sqlalchemy_utils-stubs/models.pyi @@ -0,0 +1,3 @@ +from typing import Any + +def __getattr__(name: str) -> Any: ... # incomplete diff --git a/sqlalchemy_utils-stubs/observer.pyi b/sqlalchemy_utils-stubs/observer.pyi new file mode 100644 index 0000000..e22ec74 --- /dev/null +++ b/sqlalchemy_utils-stubs/observer.pyi @@ -0,0 +1,6 @@ +from .functions import getdotattr as getdotattr, has_changes as has_changes +from .path import AttrPath as AttrPath +from .utils import is_sequence as is_sequence +from typing import Any + +def __getattr__(name: str) -> Any: ... # incomplete diff --git a/sqlalchemy_utils-stubs/operators.pyi b/sqlalchemy_utils-stubs/operators.pyi new file mode 100644 index 0000000..f584c29 --- /dev/null +++ b/sqlalchemy_utils-stubs/operators.pyi @@ -0,0 +1,4 @@ +import sqlalchemy as sa +from typing import Any + +def __getattr__(name: str) -> Any: ... # incomplete diff --git a/sqlalchemy_utils-stubs/path.pyi b/sqlalchemy_utils-stubs/path.pyi new file mode 100644 index 0000000..0651bd1 --- /dev/null +++ b/sqlalchemy_utils-stubs/path.pyi @@ -0,0 +1,4 @@ +from .utils import str_coercible as str_coercible +from typing import Any + +def __getattr__(name: str) -> Any: ... # incomplete diff --git a/sqlalchemy_utils-stubs/primitives/__init__.pyi b/sqlalchemy_utils-stubs/primitives/__init__.pyi new file mode 100644 index 0000000..6062825 --- /dev/null +++ b/sqlalchemy_utils-stubs/primitives/__init__.pyi @@ -0,0 +1,5 @@ +from .country import Country as Country +from .currency import Currency as Currency +from .ltree import Ltree as Ltree +from .weekday import WeekDay as WeekDay +from .weekdays import WeekDays as WeekDays diff --git a/sqlalchemy_utils-stubs/primitives/country.pyi b/sqlalchemy_utils-stubs/primitives/country.pyi new file mode 100644 index 0000000..f9e1397 --- /dev/null +++ b/sqlalchemy_utils-stubs/primitives/country.pyi @@ -0,0 +1,5 @@ +from .. import i18n as i18n +from ..utils import str_coercible as str_coercible +from typing import Any + +def __getattr__(name: str) -> Any: ... # incomplete diff --git a/sqlalchemy_utils-stubs/primitives/currency.pyi b/sqlalchemy_utils-stubs/primitives/currency.pyi new file mode 100644 index 0000000..dbf633c --- /dev/null +++ b/sqlalchemy_utils-stubs/primitives/currency.pyi @@ -0,0 +1,5 @@ +from .. import ImproperlyConfigured as ImproperlyConfigured, i18n as i18n +from ..utils import str_coercible as str_coercible +from typing import Any + +def __getattr__(name: str) -> Any: ... # incomplete diff --git a/sqlalchemy_utils-stubs/primitives/ltree.pyi b/sqlalchemy_utils-stubs/primitives/ltree.pyi new file mode 100644 index 0000000..8ff3ffd --- /dev/null +++ b/sqlalchemy_utils-stubs/primitives/ltree.pyi @@ -0,0 +1,6 @@ +from ..utils import str_coercible as str_coercible +from typing import Any + +path_matcher: Any + +def __getattr__(name: str) -> Any: ... # incomplete diff --git a/sqlalchemy_utils-stubs/primitives/weekday.pyi b/sqlalchemy_utils-stubs/primitives/weekday.pyi new file mode 100644 index 0000000..f9e1397 --- /dev/null +++ b/sqlalchemy_utils-stubs/primitives/weekday.pyi @@ -0,0 +1,5 @@ +from .. import i18n as i18n +from ..utils import str_coercible as str_coercible +from typing import Any + +def __getattr__(name: str) -> Any: ... # incomplete diff --git a/sqlalchemy_utils-stubs/primitives/weekdays.pyi b/sqlalchemy_utils-stubs/primitives/weekdays.pyi new file mode 100644 index 0000000..cc212f3 --- /dev/null +++ b/sqlalchemy_utils-stubs/primitives/weekdays.pyi @@ -0,0 +1,6 @@ +from typing import Any + +from ..utils import str_coercible as str_coercible +from .weekday import WeekDay as WeekDay + +def __getattr__(name: str) -> Any: ... # incomplete diff --git a/sqlalchemy_utils-stubs/proxy_dict.pyi b/sqlalchemy_utils-stubs/proxy_dict.pyi new file mode 100644 index 0000000..964e6fa --- /dev/null +++ b/sqlalchemy_utils-stubs/proxy_dict.pyi @@ -0,0 +1,3 @@ +from typing import Any + +def __getattr__(name: str) -> Any: ... # incomplete diff --git a/sqlalchemy_utils-stubs/query_chain.pyi b/sqlalchemy_utils-stubs/query_chain.pyi new file mode 100644 index 0000000..964e6fa --- /dev/null +++ b/sqlalchemy_utils-stubs/query_chain.pyi @@ -0,0 +1,3 @@ +from typing import Any + +def __getattr__(name: str) -> Any: ... # incomplete diff --git a/sqlalchemy_utils-stubs/relationships/__init__.pyi b/sqlalchemy_utils-stubs/relationships/__init__.pyi new file mode 100644 index 0000000..0093470 --- /dev/null +++ b/sqlalchemy_utils-stubs/relationships/__init__.pyi @@ -0,0 +1,4 @@ +from .chained_join import chained_join as chained_join +from typing import Any + +def __getattr__(name: str) -> Any: ... # incomplete diff --git a/sqlalchemy_utils-stubs/relationships/chained_join.pyi b/sqlalchemy_utils-stubs/relationships/chained_join.pyi new file mode 100644 index 0000000..964e6fa --- /dev/null +++ b/sqlalchemy_utils-stubs/relationships/chained_join.pyi @@ -0,0 +1,3 @@ +from typing import Any + +def __getattr__(name: str) -> Any: ... # incomplete diff --git a/sqlalchemy_utils-stubs/types/__init__.pyi b/sqlalchemy_utils-stubs/types/__init__.pyi new file mode 100644 index 0000000..1798126 --- /dev/null +++ b/sqlalchemy_utils-stubs/types/__init__.pyi @@ -0,0 +1,42 @@ +from typing import Any + +from .arrow import ArrowType as ArrowType +from .choice import Choice as Choice, ChoiceType as ChoiceType +from .color import ColorType as ColorType +from .country import CountryType as CountryType +from .currency import CurrencyType as CurrencyType +from .email import EmailType as EmailType +from .encrypted.encrypted_type import EncryptedType as EncryptedType, StringEncryptedType as StringEncryptedType +from .enriched_datetime.enriched_date_type import EnrichedDateType as EnrichedDateType +from .enriched_datetime.enriched_datetime_type import EnrichedDateTimeType as EnrichedDateTimeType +from .ip_address import IPAddressType as IPAddressType +from .json import JSONType as JSONType +from .locale import LocaleType as LocaleType +from .ltree import LtreeType as LtreeType +from .password import Password as Password, PasswordType as PasswordType +from .pg_composite import ( + CompositeType as CompositeType, + register_composites as register_composites, + remove_composite_listeners as remove_composite_listeners, +) +from .phone_number import ( + PhoneNumber as PhoneNumber, + PhoneNumberParseException as PhoneNumberParseException, + PhoneNumberType as PhoneNumberType, +) +from .range import ( + DateRangeType as DateRangeType, + DateTimeRangeType as DateTimeRangeType, + Int8RangeType as Int8RangeType, + IntRangeType as IntRangeType, + NumericRangeType as NumericRangeType, +) +from .scalar_list import ScalarListException as ScalarListException, ScalarListType as ScalarListType +from .timezone import TimezoneType as TimezoneType +from .ts_vector import TSVectorType as TSVectorType +from .url import URLType as URLType +from .uuid import UUIDType as UUIDType +from .weekdays import WeekDaysType as WeekDaysType +from sqlalchemy.orm.collections import InstrumentedList as _InstrumentedList + +def __getattr__(name: str) -> Any: ... # incomplete diff --git a/sqlalchemy_utils-stubs/types/arrow.pyi b/sqlalchemy_utils-stubs/types/arrow.pyi new file mode 100644 index 0000000..c9913de --- /dev/null +++ b/sqlalchemy_utils-stubs/types/arrow.pyi @@ -0,0 +1,6 @@ +from ..exceptions import ImproperlyConfigured as ImproperlyConfigured +from .enriched_datetime import ArrowDateTime as ArrowDateTime +from .enriched_datetime.enriched_datetime_type import EnrichedDateTimeType as EnrichedDateTimeType +from typing import Any + +def __getattr__(name: str) -> Any: ... # incomplete diff --git a/sqlalchemy_utils-stubs/types/bit.pyi b/sqlalchemy_utils-stubs/types/bit.pyi new file mode 100644 index 0000000..f584c29 --- /dev/null +++ b/sqlalchemy_utils-stubs/types/bit.pyi @@ -0,0 +1,4 @@ +import sqlalchemy as sa +from typing import Any + +def __getattr__(name: str) -> Any: ... # incomplete diff --git a/sqlalchemy_utils-stubs/types/choice.pyi b/sqlalchemy_utils-stubs/types/choice.pyi new file mode 100644 index 0000000..9fd3446 --- /dev/null +++ b/sqlalchemy_utils-stubs/types/choice.pyi @@ -0,0 +1,5 @@ +from ..exceptions import ImproperlyConfigured as ImproperlyConfigured +from .scalar_coercible import ScalarCoercible as ScalarCoercible +from typing import Any + +def __getattr__(name: str) -> Any: ... # incomplete diff --git a/sqlalchemy_utils-stubs/types/color.pyi b/sqlalchemy_utils-stubs/types/color.pyi new file mode 100644 index 0000000..9fd3446 --- /dev/null +++ b/sqlalchemy_utils-stubs/types/color.pyi @@ -0,0 +1,5 @@ +from ..exceptions import ImproperlyConfigured as ImproperlyConfigured +from .scalar_coercible import ScalarCoercible as ScalarCoercible +from typing import Any + +def __getattr__(name: str) -> Any: ... # incomplete diff --git a/sqlalchemy_utils-stubs/types/country.pyi b/sqlalchemy_utils-stubs/types/country.pyi new file mode 100644 index 0000000..b3ea182 --- /dev/null +++ b/sqlalchemy_utils-stubs/types/country.pyi @@ -0,0 +1,5 @@ +from ..primitives import Country as Country +from .scalar_coercible import ScalarCoercible as ScalarCoercible +from typing import Any + +def __getattr__(name: str) -> Any: ... # incomplete diff --git a/sqlalchemy_utils-stubs/types/currency.pyi b/sqlalchemy_utils-stubs/types/currency.pyi new file mode 100644 index 0000000..2f723d2 --- /dev/null +++ b/sqlalchemy_utils-stubs/types/currency.pyi @@ -0,0 +1,6 @@ +from .. import ImproperlyConfigured as ImproperlyConfigured, i18n as i18n +from ..primitives import Currency as Currency +from .scalar_coercible import ScalarCoercible as ScalarCoercible +from typing import Any + +def __getattr__(name: str) -> Any: ... # incomplete diff --git a/sqlalchemy_utils-stubs/types/email.pyi b/sqlalchemy_utils-stubs/types/email.pyi new file mode 100644 index 0000000..0de09f2 --- /dev/null +++ b/sqlalchemy_utils-stubs/types/email.pyi @@ -0,0 +1,5 @@ +import sqlalchemy as sa +from ..operators import CaseInsensitiveComparator as CaseInsensitiveComparator +from typing import Any + +def __getattr__(name: str) -> Any: ... # incomplete diff --git a/sqlalchemy_utils-stubs/types/encrypted/__init__.pyi b/sqlalchemy_utils-stubs/types/encrypted/__init__.pyi new file mode 100644 index 0000000..e69de29 diff --git a/sqlalchemy_utils-stubs/types/encrypted/encrypted_type.pyi b/sqlalchemy_utils-stubs/types/encrypted/encrypted_type.pyi new file mode 100644 index 0000000..f80d222 --- /dev/null +++ b/sqlalchemy_utils-stubs/types/encrypted/encrypted_type.pyi @@ -0,0 +1,7 @@ +from sqlalchemy_utils.exceptions import ImproperlyConfigured as ImproperlyConfigured +from sqlalchemy_utils.types.encrypted.padding import PADDING_MECHANISM as PADDING_MECHANISM +from sqlalchemy_utils.types.json import JSONType as JSONType +from sqlalchemy_utils.types.scalar_coercible import ScalarCoercible as ScalarCoercible +from typing import Any + +def __getattr__(name: str) -> Any: ... # incomplete diff --git a/sqlalchemy_utils-stubs/types/encrypted/padding.pyi b/sqlalchemy_utils-stubs/types/encrypted/padding.pyi new file mode 100644 index 0000000..964e6fa --- /dev/null +++ b/sqlalchemy_utils-stubs/types/encrypted/padding.pyi @@ -0,0 +1,3 @@ +from typing import Any + +def __getattr__(name: str) -> Any: ... # incomplete diff --git a/sqlalchemy_utils-stubs/types/enriched_datetime/__init__.pyi b/sqlalchemy_utils-stubs/types/enriched_datetime/__init__.pyi new file mode 100644 index 0000000..5a43ed9 --- /dev/null +++ b/sqlalchemy_utils-stubs/types/enriched_datetime/__init__.pyi @@ -0,0 +1,3 @@ +from .arrow_datetime import ArrowDateTime as ArrowDateTime +from .pendulum_date import PendulumDate as PendulumDate +from .pendulum_datetime import PendulumDateTime as PendulumDateTime diff --git a/sqlalchemy_utils-stubs/types/enriched_datetime/arrow_datetime.pyi b/sqlalchemy_utils-stubs/types/enriched_datetime/arrow_datetime.pyi new file mode 100644 index 0000000..5eba6bd --- /dev/null +++ b/sqlalchemy_utils-stubs/types/enriched_datetime/arrow_datetime.pyi @@ -0,0 +1,4 @@ +from ...exceptions import ImproperlyConfigured as ImproperlyConfigured +from typing import Any + +def __getattr__(name: str) -> Any: ... # incomplete diff --git a/sqlalchemy_utils-stubs/types/enriched_datetime/enriched_date_type.pyi b/sqlalchemy_utils-stubs/types/enriched_datetime/enriched_date_type.pyi new file mode 100644 index 0000000..a63c9d8 --- /dev/null +++ b/sqlalchemy_utils-stubs/types/enriched_datetime/enriched_date_type.pyi @@ -0,0 +1,5 @@ +from ..scalar_coercible import ScalarCoercible as ScalarCoercible +from .pendulum_date import PendulumDate as PendulumDate +from typing import Any + +def __getattr__(name: str) -> Any: ... # incomplete diff --git a/sqlalchemy_utils-stubs/types/enriched_datetime/enriched_datetime_type.pyi b/sqlalchemy_utils-stubs/types/enriched_datetime/enriched_datetime_type.pyi new file mode 100644 index 0000000..ee57865 --- /dev/null +++ b/sqlalchemy_utils-stubs/types/enriched_datetime/enriched_datetime_type.pyi @@ -0,0 +1,5 @@ +from ..scalar_coercible import ScalarCoercible as ScalarCoercible +from .pendulum_datetime import PendulumDateTime as PendulumDateTime +from typing import Any + +def __getattr__(name: str) -> Any: ... # incomplete diff --git a/sqlalchemy_utils-stubs/types/enriched_datetime/pendulum_date.pyi b/sqlalchemy_utils-stubs/types/enriched_datetime/pendulum_date.pyi new file mode 100644 index 0000000..4372d21 --- /dev/null +++ b/sqlalchemy_utils-stubs/types/enriched_datetime/pendulum_date.pyi @@ -0,0 +1,5 @@ +from ...exceptions import ImproperlyConfigured as ImproperlyConfigured +from .pendulum_datetime import PendulumDateTime as PendulumDateTime +from typing import Any + +def __getattr__(name: str) -> Any: ... # incomplete diff --git a/sqlalchemy_utils-stubs/types/enriched_datetime/pendulum_datetime.pyi b/sqlalchemy_utils-stubs/types/enriched_datetime/pendulum_datetime.pyi new file mode 100644 index 0000000..5eba6bd --- /dev/null +++ b/sqlalchemy_utils-stubs/types/enriched_datetime/pendulum_datetime.pyi @@ -0,0 +1,4 @@ +from ...exceptions import ImproperlyConfigured as ImproperlyConfigured +from typing import Any + +def __getattr__(name: str) -> Any: ... # incomplete diff --git a/sqlalchemy_utils-stubs/types/ip_address.pyi b/sqlalchemy_utils-stubs/types/ip_address.pyi new file mode 100644 index 0000000..9fd3446 --- /dev/null +++ b/sqlalchemy_utils-stubs/types/ip_address.pyi @@ -0,0 +1,5 @@ +from ..exceptions import ImproperlyConfigured as ImproperlyConfigured +from .scalar_coercible import ScalarCoercible as ScalarCoercible +from typing import Any + +def __getattr__(name: str) -> Any: ... # incomplete diff --git a/sqlalchemy_utils-stubs/types/json.pyi b/sqlalchemy_utils-stubs/types/json.pyi new file mode 100644 index 0000000..cac8b8e --- /dev/null +++ b/sqlalchemy_utils-stubs/types/json.pyi @@ -0,0 +1,6 @@ +import sqlalchemy as sa +from typing import Any + +has_postgres_json: bool + +def __getattr__(name: str) -> Any: ... # incomplete diff --git a/sqlalchemy_utils-stubs/types/locale.pyi b/sqlalchemy_utils-stubs/types/locale.pyi new file mode 100644 index 0000000..9fd3446 --- /dev/null +++ b/sqlalchemy_utils-stubs/types/locale.pyi @@ -0,0 +1,5 @@ +from ..exceptions import ImproperlyConfigured as ImproperlyConfigured +from .scalar_coercible import ScalarCoercible as ScalarCoercible +from typing import Any + +def __getattr__(name: str) -> Any: ... # incomplete diff --git a/sqlalchemy_utils-stubs/types/ltree.pyi b/sqlalchemy_utils-stubs/types/ltree.pyi new file mode 100644 index 0000000..c6abb2b --- /dev/null +++ b/sqlalchemy_utils-stubs/types/ltree.pyi @@ -0,0 +1,6 @@ +from typing import Any + +from ..primitives import Ltree as Ltree +from .scalar_coercible import ScalarCoercible as ScalarCoercible + +def __getattr__(name: str) -> Any: ... # incomplete diff --git a/sqlalchemy_utils-stubs/types/password.pyi b/sqlalchemy_utils-stubs/types/password.pyi new file mode 100644 index 0000000..9fd3446 --- /dev/null +++ b/sqlalchemy_utils-stubs/types/password.pyi @@ -0,0 +1,5 @@ +from ..exceptions import ImproperlyConfigured as ImproperlyConfigured +from .scalar_coercible import ScalarCoercible as ScalarCoercible +from typing import Any + +def __getattr__(name: str) -> Any: ... # incomplete diff --git a/sqlalchemy_utils-stubs/types/pg_composite.pyi b/sqlalchemy_utils-stubs/types/pg_composite.pyi new file mode 100644 index 0000000..ad29e59 --- /dev/null +++ b/sqlalchemy_utils-stubs/types/pg_composite.pyi @@ -0,0 +1,4 @@ +from .. import ImproperlyConfigured as ImproperlyConfigured +from typing import Any + +def __getattr__(name: str) -> Any: ... # incomplete diff --git a/sqlalchemy_utils-stubs/types/phone_number.pyi b/sqlalchemy_utils-stubs/types/phone_number.pyi new file mode 100644 index 0000000..d60b0b7 --- /dev/null +++ b/sqlalchemy_utils-stubs/types/phone_number.pyi @@ -0,0 +1,6 @@ +from ..exceptions import ImproperlyConfigured as ImproperlyConfigured +from ..utils import str_coercible as str_coercible +from .scalar_coercible import ScalarCoercible as ScalarCoercible +from typing import Any + +def __getattr__(name: str) -> Any: ... # incomplete diff --git a/sqlalchemy_utils-stubs/types/range.pyi b/sqlalchemy_utils-stubs/types/range.pyi new file mode 100644 index 0000000..9fd3446 --- /dev/null +++ b/sqlalchemy_utils-stubs/types/range.pyi @@ -0,0 +1,5 @@ +from ..exceptions import ImproperlyConfigured as ImproperlyConfigured +from .scalar_coercible import ScalarCoercible as ScalarCoercible +from typing import Any + +def __getattr__(name: str) -> Any: ... # incomplete diff --git a/sqlalchemy_utils-stubs/types/scalar_coercible.pyi b/sqlalchemy_utils-stubs/types/scalar_coercible.pyi new file mode 100644 index 0000000..964e6fa --- /dev/null +++ b/sqlalchemy_utils-stubs/types/scalar_coercible.pyi @@ -0,0 +1,3 @@ +from typing import Any + +def __getattr__(name: str) -> Any: ... # incomplete diff --git a/sqlalchemy_utils-stubs/types/scalar_list.pyi b/sqlalchemy_utils-stubs/types/scalar_list.pyi new file mode 100644 index 0000000..964e6fa --- /dev/null +++ b/sqlalchemy_utils-stubs/types/scalar_list.pyi @@ -0,0 +1,3 @@ +from typing import Any + +def __getattr__(name: str) -> Any: ... # incomplete diff --git a/sqlalchemy_utils-stubs/types/timezone.pyi b/sqlalchemy_utils-stubs/types/timezone.pyi new file mode 100644 index 0000000..9fd3446 --- /dev/null +++ b/sqlalchemy_utils-stubs/types/timezone.pyi @@ -0,0 +1,5 @@ +from ..exceptions import ImproperlyConfigured as ImproperlyConfigured +from .scalar_coercible import ScalarCoercible as ScalarCoercible +from typing import Any + +def __getattr__(name: str) -> Any: ... # incomplete diff --git a/sqlalchemy_utils-stubs/types/ts_vector.pyi b/sqlalchemy_utils-stubs/types/ts_vector.pyi new file mode 100644 index 0000000..f584c29 --- /dev/null +++ b/sqlalchemy_utils-stubs/types/ts_vector.pyi @@ -0,0 +1,4 @@ +import sqlalchemy as sa +from typing import Any + +def __getattr__(name: str) -> Any: ... # incomplete diff --git a/sqlalchemy_utils-stubs/types/url.pyi b/sqlalchemy_utils-stubs/types/url.pyi new file mode 100644 index 0000000..84bd204 --- /dev/null +++ b/sqlalchemy_utils-stubs/types/url.pyi @@ -0,0 +1,4 @@ +from .scalar_coercible import ScalarCoercible as ScalarCoercible +from typing import Any + +def __getattr__(name: str) -> Any: ... # incomplete diff --git a/sqlalchemy_utils-stubs/types/uuid.pyi b/sqlalchemy_utils-stubs/types/uuid.pyi new file mode 100644 index 0000000..84bd204 --- /dev/null +++ b/sqlalchemy_utils-stubs/types/uuid.pyi @@ -0,0 +1,4 @@ +from .scalar_coercible import ScalarCoercible as ScalarCoercible +from typing import Any + +def __getattr__(name: str) -> Any: ... # incomplete diff --git a/sqlalchemy_utils-stubs/types/weekdays.pyi b/sqlalchemy_utils-stubs/types/weekdays.pyi new file mode 100644 index 0000000..1dee15d --- /dev/null +++ b/sqlalchemy_utils-stubs/types/weekdays.pyi @@ -0,0 +1,8 @@ +from .. import i18n as i18n +from ..exceptions import ImproperlyConfigured as ImproperlyConfigured +from ..primitives import WeekDay as WeekDay, WeekDays as WeekDays +from .bit import BitType as BitType +from .scalar_coercible import ScalarCoercible as ScalarCoercible +from typing import Any + +def __getattr__(name: str) -> Any: ... # incomplete diff --git a/sqlalchemy_utils-stubs/utils.pyi b/sqlalchemy_utils-stubs/utils.pyi new file mode 100644 index 0000000..964e6fa --- /dev/null +++ b/sqlalchemy_utils-stubs/utils.pyi @@ -0,0 +1,3 @@ +from typing import Any + +def __getattr__(name: str) -> Any: ... # incomplete diff --git a/sqlalchemy_utils-stubs/view.pyi b/sqlalchemy_utils-stubs/view.pyi new file mode 100644 index 0000000..5a63a63 --- /dev/null +++ b/sqlalchemy_utils-stubs/view.pyi @@ -0,0 +1,4 @@ +from sqlalchemy_utils.functions import get_columns as get_columns +from typing import Any + +def __getattr__(name: str) -> Any: ... # incomplete