Utilities for interacting with PyPI

Related tags

Build Tools twine
Overview
https://img.shields.io/readthedocs/twine https://img.shields.io/github/workflow/status/pypa/twine/Main https://img.shields.io/codecov/c/github/pypa/twine

twine

Twine is a utility for publishing Python packages on PyPI.

It provides build system independent uploads of source and binary distribution artifacts for both new and existing projects.

See our documentation for a description of features, installation and usage instructions, and links to additional resources.

Contributing

See our developer documentation for how to get started, an architectural overview, and our future development plans.

Code of Conduct

Everyone interacting in the Twine project's codebases, issue trackers, chat rooms, and mailing lists is expected to follow the PSF Code of Conduct.

Comments
  • Can't enter password in Windows

    Can't enter password in Windows

    Your Environment

    Thank you for taking the time to report an issue.

    To more efficiently resolve this issue, we'd like to know some basic information about your system and setup.

    1. Windows 10

    2. Python 3.8.2

    3. I used pip.(pip install twine)

    4. I don't know

    5. https://github.com/mathstar13/easyapi

    If you're having issues uploading a specific package, you must include a copy of the following:

    • The package's PKG-INFO file
    • A redacted version of your .pypirc file (REMOVE ALL USERNAMES & PASSWORDS BEFORE UPLOADING)

    The Issue

    The issue is that every time I try to upload, I enter __token__ in username, but I can't enter ANY text in the password field.

    Steps to Reproduce

    Use wheel on setup.py Type in python -m twine upload --repository testpypi dist/* type in __token__ as the username Try to type in the password

    support 
    opened by mathstar13 49
  • TypeError: expected string or bytes-like object

    TypeError: expected string or bytes-like object

    Hi everyone,

    I can't seem to figure why it is giving error, is it bug:

    twine upload dist/*

    Uploading distributions to https://upload.pypi.org/legacy/
    TypeError: expected string or bytes-like object
    

    I created ~/.pypirc with creds. Also tried Env Vars, no luck :(

    opened by chhantyal 37
  • Twine not properly uploading long_description

    Twine not properly uploading long_description

    I've been trying to upload a package with twine, and no matter what I do, I can't get the long_description to render. I'm left with the generic The author of this package has not provided a project description. . There is no error message during the twine upload process.

    However, if I upload the package via python setup.py sdist upload, the long_description renders just fine, as you can see here.

    Does anyone have any idea what's going on?

    Code is here.

    opened by mdagost 33
  • PEP 484 type annotations for Twine

    PEP 484 type annotations for Twine

    Update 4/25/2020: See https://github.com/pypa/twine/issues/231#issuecomment-619359423 below for the current roadmap to completion.

    I am considering adding type annotations to Twine to help my team do static analysis of code that depends on it. Would a pull request containing type annotations be merge back?

    More info on type annotations: PEP 484: https://www.python.org/dev/peps/pep-0484/ mypy, the type-checker of choice these days: http://mypy-lang.org/

    Given the need to support Python 2.x, the preferred format for annotations would be as Type Comments, but I would be open to do .pyi stubs if that makes it easier for everyone.

    Please provide guidance and requirements and I will take it from there.

    enhancement testing 
    opened by ygingras 33
  • Are twine maintainers OK to have a `twine build` command?

    Are twine maintainers OK to have a `twine build` command?

    @pradyunsg looks at https://discuss.python.org/t/building-distributions-and-drawing-the-platypus/2062 and sighs.

    Hey @pypa/twine-team!

    Are y'all fine with twine growing a twine build command in the future? Do twine maintainers feel like twine build would be out of scope for the tool?

    The relevant context is in the first post of the discussion that I've linked to above. That discussion quickly diverged from the topic of "how to expose build logic" to "what should a unified tool for Python packaging/development workflow look like", so most replies there are not relevant to the question I'm asking here.

    If we'd be doing this, it'd be based on a shared implementation of the underlying build and install logic, that would be the result of refactoring "out" pip's existing build and install logic. This is something that I plan to be working on later this year, and I'm trying to figure out the direction that work should be headed.

    Before someone asks, yes, I checked with my fellow pip maintainers -- there's a long on-going discussion within that group privately, about what's "in scope" for pip. It seems to me that we'd be concluding that a pip build would be out of scope, which is why I'm preempting that conclusion and checking here.

    enhancement question 
    opened by pradyunsg 25
  • "410 Client Error: This API is no longer supported" during `twine register`

    I upgraded to twine-1.7.4, then did a twine register dist/foolscap-0.12.0.tar.gz, and got the following error message:

    % twine register dist/foolscap-0.12.0.tar.gz
    Registering package to https://upload.pypi.io/legacy/
    Registering foolscap-0.12.0.tar.gz
    HTTPError: 410 Client Error: This API is no longer supported, instead simply upload the file. for url: https://upload.pypi.io/legacy/
    

    I couldn't really figure out what I was doing wrong, so I downgraded to the twine-1.6.5 I'd had previously, and then twine register and twine upload worked fine.

    Is this user error, or something internal going wrong?

    opened by warner 25
  • Generate more output with --verbose option

    Generate more output with --verbose option

    Update 7/15/2020: See https://github.com/pypa/twine/issues/381#issuecomment-640955580 for a roadmap

    I was trying to debug twine usage (and especially twine upload) and making it more verbose but apparently there is no documentation about any verbose mode.

    Even if I found some references in the source code to a --verbose option, apparently this is not recognised by twine.

    Please advise how to enable a more verbose mode on twine so we would know what went wrong when we got an error like https://github.com/pypa/twine/issues/289#issuecomment-403766994

    enhancement 
    opened by ssbarnea 23
  • Twine password prompt not appearing

    Twine password prompt not appearing

    Your Environment

    Thank you for taking the time to report an issue.

    To more efficiently resolve this issue, we'd like to know some basic information about your system and setup.

    1. Your operating system:

    Windows 10

    1. Version of python you are running:

    Python v3.9.2

    1. How did you install twine? Did you use your operating system's package manager or pip or something else?

    via pip

    1. Version of twine you have installed (include complete output of):

    twine version 3.3.0 (pkginfo: 1.7.0, request: 2.25.1, setuptools: 49.2.1, requests-toolbelt: 0.9.1, tqdm: 4.58.0)

    1. Which package repository are you targeting?

    Test PyPI

    If you're having issues uploading a specific package, you must include a copy of the following:

    • The package's PKG-INFO file
    • A redacted version of your .pypirc file (REMOVE ALL USERNAMES & PASSWORDS BEFORE UPLOADING)

    The Issue

    Please describe the issue that you are experiencing.

    When running python -m twine upload --repository testpypi dist/*, the username prompt appears but the password prompt does not.

    Steps to Reproduce

    If the issue is predictable and consistently reproducible, please list the steps here.

    On Git Bash:

    1. Run python -m twine upload --repository testpypi dist/*
    2. Enter __token__ for the Enter your username prompt
    opened by JacobLee23 22
  • README on PyPI rendered incorrectly if upload includes a wheel

    README on PyPI rendered incorrectly if upload includes a wheel

    Steps to reproduce the problem

    I've reproduced this with the Resolwe project:

    git clone https://github.com/genialis/resolwe.git
    cd resolwe
    mkvirtualenv resolwe
    pip install --process-dependency-links -e .[docs,package,test]
    

    For each of the variants, I've made the following common steps:

    # bump version in resolwe/__about__.py
    python setup.py clean -a
    rm dist/*
    rm -r *.egg-info
    

    Then I've tested the following 4 variants:

    Variant 1: Make sdist and whell and upload with twine

    python setup.py sdist
    python setup.py bdist_wheel
    twine upload -r testpypi dist/*
    

    Result is here -> README not rendered correctly.

    Variant 2: Make sdist and whell and upload with setup.py upload

    python setup.py sdist bdist_wheel upload -r testpypi
    

    Result is here -> README rendered correctly.

    Variant 3: Make sdist and upload with twine

    python setup.py sdist
    twine upload -r testpypi dist/*
    

    Result is here -> README rendered correctly.

    Variant 4: Make wheel and upload with twine

    python setup.py bdist_wheel
    twine upload -r testpypi dist/*
    

    Result is here -> README not rendered correctly.

    Summary

    It appears that README is rendered incorrectly if twine upload includes a wheel.

    Additional notes

    The same problem also occurred when I uploaded the Resolwe 1.4.0 release to the real PyPI using Variant 1 described above. Note that the README is also incorrectly rendered on the new Warehouse-based PyPI frontend.

    System information:

    Fedora 24 with Python 3.5.2 and twine 1.8.1.

    All contents of the virtualenv:

    $ pip list --format=columns
    Package                     Version    Location                    
    --------------------------- ---------- ----------------------------
    alabaster                   0.7.9      
    appdirs                     1.4.0      
    args                        0.1.0      
    astroid                     1.4.9      
    Babel                       2.3.4      
    bleach                      1.5.0      
    check-manifest              0.34       
    clint                       0.5.1      
    coverage                    4.3.4      
    Django                      1.10.5     
    django-autoslug             1.9.4.dev0 
    django-filter               0.15.3     
    django-guardian             1.4.6      
    django-mathfilters          0.4.0      
    django-versionfield2        0.5.0      
    djangorestframework         3.5.3      
    djangorestframework-filters 0.9.1      
    docutils                    0.13.1     
    elasticsearch               2.4.1      
    elasticsearch-dsl           2.2.0      
    html5lib                    0.9999999  
    imagesize                   0.7.1      
    isort                       4.2.5      
    Jinja2                      2.9.4      
    jsonschema                  2.5.1      
    lazy-object-proxy           1.2.2      
    MarkupSafe                  0.23       
    mccabe                      0.6.0      
    mock                        2.0.0      
    packaging                   16.8       
    pbr                         1.10.0     
    pip                         9.0.1      
    pkginfo                     1.4.1      
    psycopg2                    2.6.2      
    pycodestyle                 2.2.0      
    pydocstyle                  1.1.1      
    Pygments                    2.2.0      
    pylint                      1.6.5      
    pyparsing                   2.1.10     
    python-dateutil             2.6.0      
    pytz                        2016.10    
    PyYAML                      3.12       
    readme-renderer             16.0       
    requests                    2.13.0     
    requests-toolbelt           0.7.0      
    resolwe                     1.4.0.4    /home/tadej/Genialis/resolwe
    resolwe-runtime-utils       1.1.0      
    setuptools                  34.0.2     
    six                         1.10.0     
    snowballstemmer             1.2.1      
    Sphinx                      1.5.2      
    sphinx-rtd-theme            0.1.9      
    testfixtures                4.13.3     
    twine                       1.8.1      
    urllib3                     1.20       
    wheel                       0.30.0a0   
    wrapt                       1.10.8
    
    opened by tjanez 21
  • Can't use twine unless it is on PATH

    Can't use twine unless it is on PATH

    I execute Twine from an unactivated virtualenv (or at least I used to until this change occurred). Probably no explicit reason to change and I can just change my habit, but thought I should put it here in case anyone else has issues.

    > ../py34_venv/bin/twine upload *
    Traceback (most recent call last):
      File "../py34_venv/bin/twine", line 11, in <module>
        sys.exit(main())
      File "/Users/bcannon/Repositories/caniusepython3/py34_venv/lib/python3.4/site-packages/twine/__main__.py", line 24, in main
        return dispatch(sys.argv[1:])
      File "/Users/bcannon/Repositories/caniusepython3/py34_venv/lib/python3.4/site-packages/twine/cli.py", line 41, in dispatch
        p = subprocess.Popen(["twine-{0}".format(args.command)] + args.args)
      File "/Users/bcannon/Repositories/cpython/default/Lib/subprocess.py", line 850, in __init__
        restore_signals, start_new_session)
      File "/Users/bcannon/Repositories/cpython/default/Lib/subprocess.py", line 1448, in _execute_child
        raise child_exception_type(errno_num, err_msg)
    FileNotFoundError: [Errno 2] No such file or directory: 'twine-upload'
    
    bug enhancement 
    opened by brettcannon 21
  • Update maintainers list on PyPI

    Update maintainers list on PyPI

    Following up on a discussion on #pypa-dev, re: https://pypi.org/project/twine/:

    Screen Shot 2020-06-01 at 6 32 17 AM

    Personally, it'd be nice to be listed as a maintainer. It might also be nice to remove folks who have moved on.

    It seems that only owners can do that. @di or @sigmavirus24 is that one of you?

    question 
    opened by bhrutledge 20
  • Remove attempt to resolve 'license' from metadata.

    Remove attempt to resolve 'license' from metadata.

    The 'license' was removed from the metadata in 2c3c0494afd7db38b4f4f8d79d853187fc942ec5, and since 617b0a607c0e78c94c1bf8b9eccc69888743b564 has resolved to None. Probably it should be removed, but for compatibility, I'm just suggesting to retain it for now. Addresses deprecation warning introduced in importlib_metadata 5.2.

    opened by jaraco 0
  • Does twine treat long_description as a mandatory field?

    Does twine treat long_description as a mandatory field?

    Your Environment

    1. Your operating system:

    Originally caught on GitHub Actions Publish to PyPI, but locally repro'd on my OSX laptop.

    1. Version of python you are running:

    3.10.8

    1. How did you install twine? Did you use your operating system's package manager or pip or something else?

    pip install twine

    1. Version of twine you have installed (include complete output of):
    twine --version
    

    4.0.2

    1. Which package repository are you targeting?

    PyPI

    If you're having issues uploading a specific package, you must include a copy of the following:

    • The package's PKG-INFO file

    PKG-INFO.txt

    The Issue

    I noticed today that my Github action to publish to pypi started failing with

    ERROR    `long_description` has syntax errors in markup and would not be rendered on PyPI.
             No content rendered from RST source.
    

    This was confusing for me because

    After coming across https://github.com/pypa/twine/issues/454, I tried to repro the issue locally and was able to do so:

    Steps to Reproduce

    I am able to reproduce this locally using the config mentioned above.

    1. Clone lyft/cartography at 36c6ed3
    2. Build my project with python -m build --sdist --wheel --outdir dist/ .
    3. Run twine 4.0.2 against dist with twine check dist/*.

    Steps I took to fix:

    I added a long_description field to setup.py and twine check now passes: Screenshot 2022-12-16 at 3 34 42 PM

    Questions

    1. Is long_description a mandatory field?
    2. If so, would it be possible to adjust the error message so that it says long_description is mandatory, instead of saying that "long_description has syntax errors"?

    Thank you for your time! Please let me know if I missed something silly in my own configs.

    opened by achantavy 1
  • Improve visibility/utility of coverage report

    Improve visibility/utility of coverage report

    As of #943, Twine is no longer using CodeCov to report on coverage. The per-file coverage report is visible in the workflow run log, but it'd be nice if it were more visible, and more granular. The comments of https://github.com/pypa/twine/issues/658 have some thoughts, but nothing really useful.

    The comments at https://github.com/pypa/twine/pull/943#issuecomment-1331402573 suggest using GHA job summaries using Markdown output from coverage.py (which will be native in v7).

    Hynek Schlawack wrote an in-depth article, which includes uploading an artifact for the excellent coverage HTML report, which supports contexts for identifying what source code executed a line of test code.

    opened by bhrutledge 0
  • Add GitHub workflow for making releases

    Add GitHub workflow for making releases

    This PR implements a GitHub workflow to automate publication of Twine releases when GitHub releases are made, using https://github.com/pypa/gh-action-pypi-publish/ to publish to PyPI.

    Needs PYPI_TOKEN to be set for the repo in order for this to succeed.

    opened by di 2
  • Envs do not works

    Envs do not works

    Hi guys,

    Setting the following env variables

    TWINE_USERNAME="__token__"
    TWINE_PASSWORD="...."
    TWINE_NON_INTERACTIVE="true"
    

    and then call

     twine upload dist/* 
    

    results in twine asking me for credentials

    Uploading distributions to https://upload.pypi.org/legacy/
    Enter your username: 
    

    Thanks

    support 
    opened by FrancescoSaverioZuppichini 5
Releases(4.0.2)
Owner
Python Packaging Authority
Python Packaging Authority
local pypi server (custom packages and auto-mirroring of pypi)

localshop A PyPI server which automatically proxies and mirrors PyPI packages based upon packages requested. It has support for multiple indexes and t

Michael van Tellingen 383 Sep 23, 2022
Python based utilities for interacting with digital multimeters that are built on the FS9721-LP3 chipset.

Python based utilities for interacting with digital multimeters that are built on the FS9721-LP3 chipset.

Fergus 1 Feb 2, 2022
A PyPI mirror client according to PEP 381 http://www.python.org/dev/peps/pep-0381/

This is a PyPI mirror client according to PEP 381 + PEP 503 http://www.python.org/dev/peps/pep-0381/. bandersnatch >=4.0 supports Linux, MacOSX + Wind

Python Packaging Authority 345 Dec 28, 2022
Python PyPi staging server and packaging, testing, release tool

devpi: PyPI server and packaging/testing/release tool This repository contains three packages comprising the core devpi system on the server and clien

null 629 Jan 1, 2023
🍯 16 honeypots in a single pypi package (DNS, HTTP Proxy, HTTP, HTTPS, SSH, POP3, IMAP, STMP, VNC, SMB, SOCKS5, Redis, TELNET, Postgres & MySQL)

Easy to setup customizable honeypots for monitoring network traffic, bots activities and username\password credentials. The current available honeypot

QeeqBox 259 Dec 31, 2022
A PyPI mirror client according to PEP 381 http://www.python.org/dev/peps/pep-0381/

This is a PyPI mirror client according to PEP 381 + PEP 503 http://www.python.org/dev/peps/pep-0381/. bandersnatch >=4.0 supports Linux, MacOSX + Wind

Python Packaging Authority 345 Dec 28, 2022
A python API for BSCScan (Binance Smart Chain Explorer), available on PyPI.

bscscan-python A complete Python API for BscScan.com, available on PyPI. Powered by BscScan.com APIs. This is a gently modified fork of the etherscan-

Panagiotis Kotsias 246 Dec 31, 2022
A simple weather tool. I made this as a way for me to learn Python, API, and PyPi packaging.

A simple weather tool. I made this as a way for me to learn Python, API, and PyPi packaging.

Clint E. 105 Dec 31, 2022
A PDM plugin to publish to PyPI

PDM Publish A PDM plugin to publish to PyPI NOTE: Consider if you need this over using twine directly Installation If you installed pdm via pipx: pipx

Branch Vincent 20 Aug 6, 2022
Install python modules from pypi from a previous date in history

pip-rewind is a command-line tool that can rewind pypi module versions (given as command-line arguments or read from a requirements.txt file) to a previous date in time.

Amar Paul 4 Jul 3, 2021
The Zig programming language, packaged for PyPI

Zig PyPI distribution This repository contains the script used to repackage the releases of the Zig programming language as Python binary wheels. This

Zig Programming Language 100 Nov 4, 2022
La source de mon module 'pyfade' disponible sur Pypi.

Version: 1.2 Introduction Pyfade est un module permettant de créer des dégradés colorés. Il vous permettra de changer chaque ligne de votre texte par

Billy 20 Sep 12, 2021
A pypi packages finder telegram bot.

PyPi-Bot A pypi packages information finder telegram bot. Made with Python3 (C) @FayasNoushad Copyright permission under MIT License License -> https:

Fayas Noushad 17 Oct 21, 2022
Automatically give thanks to Pypi packages you use in your project!

Automatically give thanks to Pypi packages you use in your project!

Ward 25 Dec 20, 2021
PyPI package for scaffolding out code for decision tree models that can learn to find relationships between the attributes of an object.

Decision Tree Writer This package allows you to train a binary classification decision tree on a list of labeled dictionaries or class instances, and

null 2 Apr 23, 2022
pypinfo is a simple CLI to access PyPI download statistics via Google's BigQuery.

pypinfo: View PyPI download statistics with ease. pypinfo is a simple CLI to access PyPI download statistics via Google's BigQuery. Installation pypin

Ofek Lev 351 Dec 26, 2022
Command-line interface to PyPI Stats API to get download stats for Python packages

pypistats Python 3.6+ interface to PyPI Stats API to get aggregate download statistics on Python packages on the Python Package Index without having t

Hugo van Kemenade 140 Jan 3, 2023
Check if Python package names are available on PyPI.

?? isavailable Can I haz this Python package on PyPI? Check if Python package names are available on PyPI. Usage $ isavailable checks whether your des

Felipe S. S. Schneider 3 May 18, 2022
A pypi package that helps in generating discord bots.

A pypi package that helps in generating discord bots.

PineCode Corp 3 Nov 17, 2021
A pypi package that helps in generating discord bots.

A pypi package that helps in generating discord bots.

KlevrHQ 3 Nov 17, 2021