|
1 | | -# template-python-types |
2 | | - |
3 | | -###(For the instructions below, the original packagename will be assumed to be `foo-bar`. Adapt this to your use case) |
4 | | - |
5 | | -Step-by-step instructions on using this template: |
6 | | - |
7 | | -- Create a new repository using this template. Name it `types-foo-bar`. |
8 | | - - Set up anything that may not carry over from the template (branch permissions, enabling the renovate bot, etc) |
9 | | - - 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) |
10 | | - - 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 |
11 | | -- Replace all instances of `changeme` strings as follows: |
12 | | - - Replace these: |
13 | | - - `changeme-package-name` => `foo-bar` (name of the original package) |
14 | | - - `changeme-types-package-name` => `types-foo-bar` (name of your stubs package; **must** start with `types-`) |
15 | | - - `changeme-package-name-stubs` => `foo-bar-stubs` (name of the stubs root folder; **must** end with `-stubs`) |
16 | | - - In the following files: |
17 | | - - `README.md` |
18 | | - - `.releaserc` |
19 | | - - `.pre-commit-config.yaml` |
20 | | - - `setup.py` |
21 | | -- Rename the folder `changeme-package-name-stubs` to `foo-bar-stubs`. This will be the root folder for all the stub files |
22 | | -- 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) |
23 | | -- Update the package's information in `setup.py` |
24 | | - - Add/Update the [classifiers](https://pypi.org/classifiers/) to help people find the package |
25 | | - - Add some keywords (like the original package name, related frameworks, etc) to help people find the package |
26 | | - - Change the versions in `python_requires` if necessary. Make sure it matches the versions listed in the classifiers |
27 | | -- Add the dependencies: |
28 | | - - Add your dependencies to the `Pipfile` with an exact version |
29 | | - - Run `$ pipenv install -d` to update the `Pipfile.lock` |
30 | | - - Run `$ pipenv shell` to switch to a shell within the virtual environment |
31 | | - - Run `$ pipenv-setup sync --pipfile --dev` to sync the dependencies to the `setup.py` |
32 | | -- Install the pre-commit hook (see below, in the `Developing` section) |
33 | | -- Add your stubs |
34 | | - - [Optional] Mark the `foo-bar-stubs` directory as `Sources Root` and the `.mypy_cache` directory as `Excluded` |
35 | | - - 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 |
36 | | - - 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 |
37 | | -- Test your stubs |
38 | | - - 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) |
39 | | -- Uncomment the action in `.github/workflows/on-push-to-main.yml` to allow the package to be released |
40 | | -- Remove these instructions from `README.md` (they will still be available in the template repo for the next steps) |
41 | | -- A search through the whole project (CTRL + Shift + F in PyCharm) should find no results for `changeme` |
42 | | -- Release the package |
43 | | - - Merge your changes into the `main` branch (preferably via PR) |
44 | | - - Wait for the GH Action to run, and the package to be released |
45 | | - - The package should be available at https://pypi.org/project/types-foo-bar/ |
46 | | - - Download your package and test it again as a final check |
47 | | - |
48 | | -# changeme-types-package-name |
| 1 | +# types-python-jose |
49 | 2 |
|
50 | 3 | This is a package containing type annotations |
51 | | -for [changeme-package-name](https://pypi.org/project/changeme-package-name/). |
| 4 | +for [python-jose](https://pypi.org/project/python-jose/). |
52 | 5 |
|
53 | 6 | ### Installing: |
54 | 7 |
|
55 | 8 | Simply run the following in the environment in which you want to install this package: |
56 | 9 |
|
57 | 10 | ```shell |
58 | | -# install changeme-types-package-name |
59 | | -$ python -m pip install changeme-types-package-name |
| 11 | +# install types-python-jose |
| 12 | +$ python -m pip install types-python-jose |
60 | 13 | ``` |
61 | 14 |
|
62 | 15 | or add it to your requirements file. |
63 | 16 |
|
64 | 17 | ### Developing |
65 | 18 |
|
66 | | -This is a partial stub package, only covering a part of the functions and objects available in `changeme-package-name`. |
67 | | -Contributions (both in adding stubs for more functions, or keeping up to date with `changeme-package-name` itself) are |
| 19 | +This is a partial stub package, only covering a part of the functions and objects available in `python-jose`. |
| 20 | +Contributions (both in adding stubs for more functions, or keeping up to date with `python-jose` itself) are |
68 | 21 | welcome. |
69 | 22 |
|
70 | 23 | All the formatting is done using [pre-commit](https://pre-commit.com/). To use this, run the following: |
|
0 commit comments