mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-23 08:11:00 +00:00
also build wheels
This commit is contained in:
parent
459ab0434f
commit
d3570747e8
36
rtool.py
36
rtool.py
@ -14,6 +14,7 @@ import pprint
|
|||||||
from zipfile import ZipFile
|
from zipfile import ZipFile
|
||||||
import tarfile
|
import tarfile
|
||||||
import platform
|
import platform
|
||||||
|
import sys
|
||||||
|
|
||||||
import click
|
import click
|
||||||
|
|
||||||
@ -73,7 +74,17 @@ def version(project):
|
|||||||
return runpy.run_path(projects[project]["vfile"])["VERSION"]
|
return runpy.run_path(projects[project]["vfile"])["VERSION"]
|
||||||
|
|
||||||
def sdist_name(project):
|
def sdist_name(project):
|
||||||
return "{project}-{version}.tar.gz".format(project=project, version=version(project))
|
return "{project}-{version}.tar.gz".format(
|
||||||
|
project=project,
|
||||||
|
version=version(project)
|
||||||
|
)
|
||||||
|
|
||||||
|
def wheel_name(project):
|
||||||
|
return "{project}-{version}-py{py_version}-none-any.whl".format(
|
||||||
|
project=project,
|
||||||
|
version=version(project),
|
||||||
|
py_version=sys.version_info.major
|
||||||
|
)
|
||||||
|
|
||||||
@contextlib.contextmanager
|
@contextlib.contextmanager
|
||||||
def empty_pythonpath():
|
def empty_pythonpath():
|
||||||
@ -170,7 +181,7 @@ def sdist():
|
|||||||
subprocess.check_call(
|
subprocess.check_call(
|
||||||
[
|
[
|
||||||
"python", "./setup.py",
|
"python", "./setup.py",
|
||||||
"-q", "sdist", "--dist-dir", DIST_DIR, "--formats=gztar"
|
"-q", "sdist", "--dist-dir", DIST_DIR, "--formats=gztar", "bdist_wheel", "--dist-dir", DIST_DIR,
|
||||||
],
|
],
|
||||||
cwd=conf["dir"]
|
cwd=conf["dir"]
|
||||||
)
|
)
|
||||||
@ -183,7 +194,7 @@ def sdist():
|
|||||||
with chdir(DIST_DIR):
|
with chdir(DIST_DIR):
|
||||||
for project, conf in projects.items():
|
for project, conf in projects.items():
|
||||||
print("Installing %s..." % project)
|
print("Installing %s..." % project)
|
||||||
subprocess.check_call([VENV_PIP, "install", "-q", sdist_name(project)])
|
subprocess.check_call([VENV_PIP, "install", "-q", wheel_name(project)])
|
||||||
|
|
||||||
print("Running binaries...")
|
print("Running binaries...")
|
||||||
for project, conf in projects.items():
|
for project, conf in projects.items():
|
||||||
@ -262,15 +273,16 @@ def upload_release(username, password, repository):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
for project in projects.keys():
|
for project in projects.keys():
|
||||||
print("Uploading {} to {}...".format(project, repository))
|
for f in (sdist_name(project), wheel_name(project)):
|
||||||
subprocess.check_call([
|
print("Uploading {} to {}...".format(f, repository))
|
||||||
"twine",
|
subprocess.check_call([
|
||||||
"upload",
|
"twine",
|
||||||
"-u", username,
|
"upload",
|
||||||
"-p", password,
|
"-u", username,
|
||||||
"-r", repository,
|
"-p", password,
|
||||||
join(DIST_DIR, sdist_name(project))
|
"-r", repository,
|
||||||
])
|
join(DIST_DIR, f)
|
||||||
|
])
|
||||||
|
|
||||||
|
|
||||||
@cli.command("wizard")
|
@cli.command("wizard")
|
||||||
|
7
setup.py
7
setup.py
@ -5,9 +5,10 @@ setup(
|
|||||||
version='1.0',
|
version='1.0',
|
||||||
py_modules=['rtool'],
|
py_modules=['rtool'],
|
||||||
install_requires=[
|
install_requires=[
|
||||||
'click~=6.2',
|
'click>=6.2',
|
||||||
'twine~=1.6.4',
|
'twine>=1.6.4',
|
||||||
'virtualenv~=13.1.2',
|
'virtualenv>=13.1.2',
|
||||||
|
'wheel>=0.26.0',
|
||||||
],
|
],
|
||||||
entry_points={
|
entry_points={
|
||||||
'console_scripts': [
|
'console_scripts': [
|
||||||
|
Loading…
Reference in New Issue
Block a user