Skip to content

Commit 93edb18

Browse files
authored
Merge pull request #257 from glimchb/setuptools
pyproject.toml instead of setup.py for new packaging
2 parents ccd50bd + 79edce0 commit 93edb18

3 files changed

Lines changed: 76 additions & 18 deletions

File tree

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# This workflow will upload a Python Package using Twine when a release is created
2+
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
3+
4+
# This workflow uses actions that are not certified by GitHub.
5+
# They are provided by a third-party and are governed by
6+
# separate terms of service, privacy policy, and support
7+
# documentation.
8+
9+
name: Upload Python Package
10+
11+
on:
12+
release:
13+
types: [published]
14+
push:
15+
branches: [ main ]
16+
# Publish semver tags as releases.
17+
tags: [ 'v*.*.*' ]
18+
pull_request:
19+
branches: [ main ]
20+
21+
workflow_dispatch:
22+
23+
jobs:
24+
deploy:
25+
26+
runs-on: ubuntu-latest
27+
28+
steps:
29+
- uses: actions/checkout@v2
30+
- name: Set up Python
31+
uses: actions/setup-python@v2
32+
with:
33+
python-version: '3.x'
34+
- name: Install dependencies
35+
run: |
36+
sudo apt-get install libjson-c-dev meson
37+
python -m pip install --upgrade pip
38+
pip install build
39+
- name: Build package
40+
run: python -m build --sdist
41+
- name: Publish package to TestPyPI
42+
uses: pypa/gh-action-pypi-publish@release/v1
43+
with:
44+
user: __token__
45+
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
46+
repository_url: https://test.pypi.org/legacy/
47+
# - name: Publish package to PyPI
48+
# if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
49+
# uses: pypa/gh-action-pypi-publish@release/v1
50+
# with:
51+
# user: __token__
52+
# password: ${{ secrets.PYPI_API_TOKEN }}

libnvme/setup.py

Lines changed: 0 additions & 18 deletions
This file was deleted.

pyproject.toml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
[build-system]
2+
requires = ["mesonpep517", "wheel", "meson", "ninja"] # PEP 508 specifications.
3+
build-backend = "mesonpep517.buildapi"
4+
5+
[tool.mesonpep517.metadata]
6+
author="Hannes Reinecke"
7+
author-email="[email protected]"
8+
classifiers = [
9+
"Intended Audience :: Developers",
10+
"Development Status :: 5 - Production/Stable",
11+
"License :: OSI Approved :: GNU Lesser General Public License v2 or later (LGPLv2+)",
12+
"Programming Language :: Python :: 3",
13+
"Programming Language :: Python :: 3.6",
14+
"Programming Language :: Python :: 3.7",
15+
"Programming Language :: Python :: 3.8",
16+
"Programming Language :: Python :: 3.9",
17+
"Topic :: Software Development :: Libraries :: Python Modules",
18+
]
19+
description-file="README.md"
20+
home-page = "https://github.com/linux-nvme/libnvme"
21+
license="LGPL-2.1-or-later"
22+
requires-python=">=3.6"
23+
summary="python bindings for libnvme"
24+

0 commit comments

Comments
 (0)