Utilities for interacting with PyPI

Related tags

Build Toolstwine
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
Software build automation tool for Python.

PyBuilder — an easy-to-use build automation tool for Python PyBuilder is a software build tool written in 100% pure Python, mainly targeting Python ap

PyBuilder 1.5k Jan 04, 2023
bitbake tool

Bitbake ======= BitBake is a generic task execution engine that allows shell and Python tasks to be run efficiently and in parallel while working wit

openembedded 336 Dec 27, 2022
A pynt of Python build.

A pynt of Python build. Raghunandan Rao Features Easy to learn. Build tasks are just python funtions. Manages dependencies between tasks. Automaticall

Raghunandan Rao 154 Jan 04, 2023
PlatformIO is a professional collaborative platform for embedded development :alien: A place where Developers and Teams have true Freedom! No more vendor lock-in!

PlatformIO Quick Links: Web | PlatformIO IDE | Project Examples | Docs | Donate | Contact Us Social: LinkedIn | Twitter | Facebook | Community Forums

PlatformIO 6.5k Jan 08, 2023
Official project repository for the Setuptools build system

See the Installation Instructions in the Python Packaging User's Guide for instructions on installing, upgrading, and uninstalling Setuptools. Questio

Python Packaging Authority 1.9k Jan 08, 2023
Smaller, easier, more powerful, and more reliable than make. An implementation of djb's redo.

redo - a recursive build system Smaller, easier, more powerful, and more reliable than make. This is an implementation of Daniel J. Bernstein's redo b

1.7k Jan 04, 2023
Python-based project scripting.

Paver - Easy Scripting for Software Projects Web: https://pythonhosted.org/Paver/ Download: https://pypi.python.org/pypi/Paver/ Source: https://github

Paver community 452 Dec 09, 2022
Pythonic task management & command execution.

Welcome to Invoke! Invoke is a Python (2.7 and 3.4+) library for managing shell-oriented subprocesses and organizing executable Python code into CLI-i

3.8k Jan 06, 2023
This is a simple tool for bootstrapping Chimera systems from binaries. For source builds, you want cports.

chimera-bootstrap This is a simple tool for bootstrapping Chimera systems from binaries. For source builds, you want cports. Simple usage: $ # run as

Chimera Linux 7 Feb 11, 2022
This is a python helper package for Telebirr H5 Web payment integration helper.

Project Glow Greetings, I see you have stumbled upon project glow. Project glow is an open source bot worked on by many people to create a good and sa

24 Dec 13, 2022
Dev is a Makefile replacement for modern development environments

Dev Dev is a Makefile replacement for modern development environments. Dev let's

Mason Data 9 Dec 09, 2022
The Pants Build System

Pants Build System Pants is a scalable build system for monorepos: codebases containing multiple projects, often using multiple programming languages

Pants Build 2.5k Jan 07, 2023
Buildout is a deployment automation tool written in and extended with Python

Buildout Buildout is a project designed to solve 2 problems: Application-centric assembly and deployment Assembly runs the gamut from stitching togeth

buildout 552 Nov 26, 2022
SCons - a software construction tool

SCons - a software construction tool Welcome to the SCons development tree. The real purpose of this tree is to package SCons for production distribut

SCons Project 1.6k Jan 03, 2023
🔨🐍Make-like build automation tool for Python projects with extensive DSL features.

Pyke (WIP, Beta Release) Make-like build automation tool for Python projects with extensive DSL features. Features: Users can specify tasks, subtasks,

Ire 17 Jul 05, 2022
Utilities for interacting with PyPI

twine Twine is a utility for publishing Python packages on PyPI. It provides build system independent uploads of source and binary distribution artifa

Python Packaging Authority 1.4k Jan 05, 2023
Package, distribute, and update any app for Linux and IoT.

Snapcraft Package, distribute, and update any app for Linux and IoT. Snaps are containerised software packages that are simple to create and install.

1.1k Jan 02, 2023
task management & automation tool

README doit - automation tool doit comes from the idea of bringing the power of build-tools to execute any kind of task Sample Code Define functions r

doit 1.5k Dec 30, 2022
Simplified packaging of Python modules

Flit is a simple way to put Python packages and modules on PyPI. It tries to require less thought about packaging and help you avoid common mistakes.

Thomas Kluyver 1.9k Jan 05, 2023
Ninja is a small build system with a focus on speed.

Ninja Ninja is a small build system with a focus on speed. https://ninja-build.org/ See the manual or doc/manual.asciidoc included in the distribution

8.9k Dec 30, 2022