Git Product home page Git Product logo

stub_uploader's Introduction

stub_uploader

Build status Upload status

This repository contains scripts and GitHub actions to auto-upload typeshed stubs to PyPI. The directory layout is self-explanatory:

  • /scripts contains the Python scripts used by GitHub actions.
  • /tests contains some tests for the above scripts.
  • /data keeps the state for upload tasks. Currently this is the last typeshed commit successfully uploaded. And the list of distributions successfully uploaded. These files are modified by the actions as described below. Finally, there is an empty stub package used to test that PyPI API token is still valid.

There are four GitHub actions in the repository. Here is a brief explanation of the role of each action.

Check scripts (CI)

This CI action simply runs mypy and tests on each PR and push. You don't need to run it manually.

Test PyPI API token

This action can be used to check if PyPI API token issued to typeshed_bot account is still valid. You normally need to only do it if there is a breakage that needs to be investigated. The action can be only started manually, to do this go to the action page and click "Run workflow". Then in the input window select a version increment for test package that is not present on PyPI. If you select X, the action will attempt to upload version 0.1.X of the package. It should only take few seconds. Check that the version you selected was indeed successfully uploaded. If it was, it means the API token is valid, otherwise read the action logs to figure out the issue. If the token is expired, generate a new token on PyPI and update the value of TYPESHED_BOT_API_TOKEN on this page.

Daily update of stubs from typeshed to PyPI

This is the main action for automatically updating the stub packages. It is scheduled to run on a regular basis (currently every three hours). Note that GitHub cron scheduling is not very precise, and can schedule action several minutes late. If necessary, it can be run manually by clicking on "Run workflow". The action will fetch typeshed repository, take the diff from last successfully updated typeshed commit, and check if anything is changed in /stubs directory. If yes, it will build and upload corresponding distributions. Then it will update the typeshed commit, and the list of packages (if new packages were uploaded) in the /data directory (see above). Note that the packages are uploaded in the dependency order, to verify that we don't depend on some foreign packages. Note that if METADATA.toml for a distribution specifies version X.Y, this will check what is the latest uploaded minor version X.Y.Z and will upload X.Y.Z+1, if there are no matching version, it will upload X.Y.0.

Force update of some stubs from typeshed to PyPI

This action can be run to manually force upload new version of some packages. When you click on "Run workflow", you will need to select the name of distribution to upload. This can be a Python regexp, for example, six will only upload the six package, "(typing-extensions|mypy-extensions)" will upload both packages, and entering ".*" will select all packages (quotes are needed since these are passed as arguments in bash). Note that this action also sorts packages in the dependency order, but it doesn't update the typeshed commit. It may update list of uploaded packages if this is the first time the package is uploaded.

stub_uploader's People

Contributors

ilevkivskyi avatar srittau avatar nipunn1313 avatar jellezijlstra avatar hauntsaninja avatar terceiro avatar nemacysts avatar robbesneyders avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.