A PDM plugin to publish to PyPI

Related tags

Miscellaneous pypi pdm
Overview

PDM Publish

ci pypi version code style: black checked with mypy

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 inject pdm pdm-publish

or brew:

$(brew --prefix pdm)/libexec/bin/python -m pip install pdm-publish

or pip:

pip install --user pdm-publish

Usage

pdm-publish enables pdm to publish packages to PyPI by wrapping twine internally. For example, to build and publish:

# Using token auth
pdm publish --password token
# To test PyPI using basic auth
pdm publish -r testpypi -u username -P password
# To custom index
pdm publish -r https://custom.index.com/

Full usage:

$ pdm publish --help
Upload artifacts to a remote repository

Usage:

Options:
  -h, --help            show this help message and exit
  -v, --verbose         -v for detailed output and -vv for more detailed
  -g, --global          Use the global project, supply the project root with
                        `-p` option
  -p PROJECT_PATH, --project PROJECT_PATH
                        Specify another path as the project root, which
                        changes the base of pyproject.toml and __pypackages__
  -r REPOSITORY, --repository REPOSITORY
                        The repository name or url to publish the package to
                        [env var: PDM_PUBLISH_REPO]
  -u USERNAME, --username USERNAME
                        The username to access the repository [env var:
                        PDM_PUBLISH_USERNAME]
  -P PASSWORD, --password PASSWORD
                        The password to access the repository [env var:
                        PDM_PUBLISH_PASSWORD]
  --dry-run             Perform all actions except upload the package
  --no-build            Don't build the package before publishing

Configuration

Config Item Description Default Value Available in Project Env var
publish.repo PyPI repo name (pypi/testpypi) or url pypi True PDM_PUBLISH_REPO
publish.username PyPI username __token__ True PDM_PUBLISH_USERNAME
publish.password PyPI password True PDM_PUBLISH_PASSWORD

Links

You might also like...
A simple but flexible plugin system for Python.

PluginBase PluginBase is a module for Python that enables the development of flexible plugin systems in Python. Step 1: from pluginbase import PluginB

Poetry plugin to bundle projects into various formats

Poetry bundle plugin This package is a plugin that allows the bundling of Poetry projects into various formats. Installation The easiest way to instal

Simple card retirement plugin for Anki

Anki Retirement Addon Allow users to suspend, tag, delete, or move cards that reach a specific retirement interval Supports Anki version 2.1.45 Licens

A maubot plugin to invite users to Matrix rooms according to LDAP groups

LDAP Inviter Bot This is a maubot plugin that invites users to Matrix rooms according to their membership in LDAP groups.

Plugin to generate BOM + CPL files for JLCPCB
Plugin to generate BOM + CPL files for JLCPCB

KiCAD JLCPCB tools Plugin to generate all files necessary for JLCPCB board fabrication and assembly Gerber files Excellon files BOM file CPL file Furt

IDA Pro plugin that shows the comments in a database
IDA Pro plugin that shows the comments in a database

ShowComments A Simple IDA Pro plugin that shows the comments in a database Installation Copy the file showcomments.py to the plugins folder under IDA

Poetry workspace plugin for Python monorepos.

poetry-workspace-plugin Poetry workspace plugin for Python monorepos. Inspired by Yarn Workspaces. Adds a new subcommand group, poetry workspace, whic

A plugin for poetry that allows you to execute scripts defined in your pyproject.toml, just like you can in npm or pipenv

poetry-exec-plugin A plugin for poetry that allows you to execute scripts defined in your pyproject.toml, just like you can in npm or pipenv Installat

tox-gh is a tox plugin which helps running tox on GitHub Actions with multiple different Python versions on multiple workers in parallel

tox-gh is a tox plugin which helps running tox on GitHub Actions with multiple different Python versions on multiple workers in parallel. This project is inspired by tox-travis.

Comments
  • Github Action fails due to getpass.py

    Github Action fails due to getpass.py

    When trying to use a Github Action to publish to Pypi.org, I receive the following error:

    Run pdm publish -u __token__ -p ***
    /opt/hostedtoolcache/Python/3.8.12/x64/lib/python3.8/getpass.py:91: GetPassWarning: Can not control echo on the terminal.
    Password:
      passwd = fallback_getpass(prompt, stream)
    Warning: Password input may be echoed.
     [Abort]: 
    Add '-v' to see the detailed traceback
    Error: Process completed with exit code 1.
    
    opened by garysb 0
  • _Py_HashRandomization_Init fails on windows

    _Py_HashRandomization_Init fails on windows

    Running the generated command manually (without non-interactive, of course) works fine, invoking thru pdm-publish raises the following error,

     - Adding scikit_bio_parasail-0.0.1.dist-info/RECORD
    Built wheel at C:/Users/andre/source/scikit-bio-parasail/dist\scikit_bio_parasail-0.0.1-py3-none-any.whl
    Publish failed
    Fatal Python error: _Py_HashRandomization_Init: failed to get random numbers to initialize Python
    Python runtime state: preinitialized
    
    
    Traceback (most recent call last):
      File "C:\Users\andre\scoop\apps\python\current\lib\runpy.py", line 196, in _run_module_as_main
        return _run_code(code, main_globals, None,
      File "C:\Users\andre\scoop\apps\python\current\lib\runpy.py", line 86, in _run_code
        exec(code, run_globals)
      File "C:\Users\andre\scoop\apps\pdm\current\venv\Scripts\pdm.exe\__main__.py", line 7, in <module>
      File "C:\Users\andre\scoop\apps\pdm\1.13.6\venv\lib\site-packages\pdm\core.py", line 233, in main
        return Core().main(args)
      File "C:\Users\andre\scoop\apps\pdm\1.13.6\venv\lib\site-packages\pdm\core.py", line 168, in main
        raise cast(Exception, err).with_traceback(traceback)
      File "C:\Users\andre\scoop\apps\pdm\1.13.6\venv\lib\site-packages\pdm\core.py", line 163, in main
        f(options.project, options)
      File "C:\Users\andre\scoop\apps\pdm\1.13.6\venv\lib\site-packages\pdm_publish\command.py", line 74, in handle
        publisher.publish(
      File "C:\Users\andre\scoop\apps\pdm\1.13.6\venv\lib\site-packages\pdm_publish\core.py", line 49, in publish
        resp.check_returncode()
      File "C:\Users\andre\scoop\apps\python\current\lib\subprocess.py", line 456, in check_returncode
        raise CalledProcessError(self.returncode, self.args, self.stdout,
    subprocess.CalledProcessError: Command '['C:\\Users\\andre\\scoop\\apps\\pdm\\1.13.6\\venv\\Scripts\\python.exe', '-m', 'twine', 'upload', '--non-interactive', '--repository', 'pypi', '--username', '__token__', 'C:\\Users\\andre\\source\\scikit-bio-parasail\\dist\\scikit_bio_parasail-0.0.1-py3-none-any.whl', 'C:\\Users\\andre\\source\\scikit-bio-parasail\\dist\\scikit-bio-parasail-0.0.1.tar.gz']' returned non-zero exit status 1.
    
    
    opened by theAeon 1
Releases(v0.2.1)
Owner
Branch Vincent
Branch Vincent
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
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
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 details search python module

A pypi package details search python module

Fayas Noushad 5 Nov 30, 2021
PyPIContents is an application that generates a Module Index from the Python Package Index (PyPI) and also from various versions of the Python Standard Library.

PyPIContents is an application that generates a Module Index from the Python Package Index (PyPI) and also from various versions of the Python Standar

Collage Labs 10 Nov 19, 2022
A simple but flexible plugin system for Python.

PluginBase PluginBase is a module for Python that enables the development of flexible plugin systems in Python. Step 1: from pluginbase import PluginB

Armin Ronacher 1k Dec 16, 2022
A Linux webcam plugin for BGMv2 as used in our demos.

The goal of this repository is to supplement the main Real-Time High Resolution Background Matting repo with a working demo of a videoconferencing plu

Andrey Ryabtsev 144 Dec 27, 2022
flake8 plugin which forbids match statements (PEP 634)

flake8-match flake8 plugin which forbids match statements (PEP 634)

Anthony Sottile 25 Nov 1, 2022
A minimalist production ready plugin system

pluggy - A minimalist production ready plugin system This is the core framework used by the pytest, tox, and devpi projects. Please read the docs to l

pytest-dev 876 Jan 5, 2023