mirror of
https://github.com/drone-plugins/drone-pypi.git
synced 2026-06-04 18:24:00 +08:00
601255d8ff
Added instructions and artifacts required to test against the PyPI test server. Also did some minor API refactoring. This plugin was successfully validated against the test PyPI server.
29 lines
683 B
Python
29 lines
683 B
Python
from setuptools import setup
|
|
import subprocess
|
|
|
|
|
|
def get_version():
|
|
try:
|
|
git = subprocess.Popen(
|
|
["git", "describe", "--long"],
|
|
stdout=subprocess.PIPE,
|
|
stderr=subprocess.PIPE)
|
|
except Exception:
|
|
return "0.0.0"
|
|
val = git.communicate()[0]
|
|
if git.returncode != 0:
|
|
return "0.0.0"
|
|
l = val.strip().split("-")
|
|
return l[0] + "." + l[1]
|
|
|
|
|
|
setup(
|
|
name="drone-pypi",
|
|
version=get_version(),
|
|
description="Module for testing drone-pypi.",
|
|
url="http://github.com/drone-plugins/drone-pypi",
|
|
packages=["drone_pypi"],
|
|
maintainer="Drone Contributors",
|
|
maintainer_email="support@drone.io",
|
|
)
|