Skip to main content

Sample project for PEP-561 distribution testing

Project description

esp32-test-stubs

Sample project for test PEP-561

Notice: It is only "proof-of-concept" of PEP-561 package so not for production use, package can be deleted in the future.

Installation

pip3 install esp32-test-stubs

Script

import machine
machine.freq()

import esp32
esp32.NVS()
esp32.wake_on_ext0("Test")

from esp.sub_pkg import sub_pkg_fun
sub_pkg_fun()

from esp32.sub_pkg import sub_pkg_function
sub_pkg_function()

import uuid

# Points to stdlib
uuid.uuid4()

# Points to stub (mean partial stub, so extent stdlib)
# see uuid-stubs and py.typed
uuid.uuid6()

import upip
upip.cleanup()

Stubs possible locations

  • project root *.pyi files
  • <package>-stubs with __init__.pyi see PEP-561
  • <package>-stubs/<sub_package>.pyi see stub-only-packages
  • custom folder like src, marked as package = [{ include = "*.pyi" , from = "src"}], under hood all *.pyi will be moved into package root during package build.
    CONS: Not recommended as custom folder does not recognize as stub source before stub package will pack properly. Also in *.tar.gz stubs not moved properly, so it led to potential errors during stub recognition

Note all of these variants should be explicitly marked in pyproject.toml in Poetry see package section

Poetry commands

  • Prepare

    poetry config repositories.testpypi https://test.pypi.org/legacy/
    poetry config pypi-token.testpypi <TOKEN>
    
    poetry config repositories.pypi https://upload.pypi.org/legacy/
    poetry config pypi-token.pypi <TOKEN>
    
  • Publish

    poetry publish --build -r testpypi
    poetry publish --build -r pypi
    

Links

Footnotes

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

esp32-test-stubs-0.1.2.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

esp32_test_stubs-0.1.2-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

Details for the file esp32-test-stubs-0.1.2.tar.gz.

File metadata

  • Download URL: esp32-test-stubs-0.1.2.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.4 CPython/3.8.10 Linux/5.4.0-89-generic

File hashes

Hashes for esp32-test-stubs-0.1.2.tar.gz
Algorithm Hash digest
SHA256 b729d5a81574d4dffb4eba9c85eeb127275e0f89f068df3f072ec0c29b260cd8
MD5 e4cba7a8012c22aee84ee382d6f4aa16
BLAKE2b-256 1554dd17f0727cfbd9a1723147e1d8733d7e386c3f629b947f15b72dba9f77ce

See more details on using hashes here.

File details

Details for the file esp32_test_stubs-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: esp32_test_stubs-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 4.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.4 CPython/3.8.10 Linux/5.4.0-89-generic

File hashes

Hashes for esp32_test_stubs-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ca9c674397dd2a426017324ed6a38fb91e548292695ec5fc03013aef0d900c87
MD5 7caf521bd304013ee023b0f0d3a2b369
BLAKE2b-256 d3efb0717778eb7b3c47fd5e615562204d174285bbe25cbb3cc05dd5a1df9644

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page