freeze requirements and update python version to build pex (#434)

This commit is contained in:
Chad Smith 2022-06-21 21:41:01 -07:00 committed by GitHub
parent 9be90ff15e
commit 9138473156
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 31 additions and 27 deletions

View file

@ -1,4 +1,4 @@
name: Build native gdbgui executables
name: Build native gdbgui executables with pyinstaller and pex
on:
pull_request:
@ -13,7 +13,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
python-version: [3.9]
python-version: ["3.10"]
include:
- os: ubuntu-latest
buildname: linux
@ -33,7 +33,7 @@ jobs:
python -m pip install nox
- name: Compile ${{ matrix.buildname }} gdbgui executable
run: |
nox --non-interactive --session build_executable_${{ matrix.buildname }}
nox --non-interactive --session build_executables_${{ matrix.buildname }}
- name: Upload ${{ matrix.buildname }} executable
# if: github.ref == 'refs/heads/master'
uses: actions/upload-artifact@v2

View file

@ -15,7 +15,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
python-version: [3.9]
python-version: ["3.10"]
steps:
- uses: actions/checkout@v2
@ -39,7 +39,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
python-version: [3.9]
python-version: ["3.10"]
steps:
- uses: actions/checkout@v2
@ -78,7 +78,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.9
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip

View file

@ -4,6 +4,7 @@
- Compatibility with Werkzeug 2.1. Use the eventlet server instead of
the Werkzeug development server.
- Use pinned requirements instead of abstract requirements to ensure reproducability of pip installs
## 0.15.0.1

View file

@ -1,6 +1,6 @@
include README.md
include LICENSE
include requirements.in
include requirements.txt
graft gdbgui
# these files are built and must be included in distribution
@ -30,7 +30,7 @@ exclude jest.config.js
exclude make_executable.py
exclude mkdocs.yml
exclude package.json
exclude requirements.txt
exclude requirements.in
exclude tsconfig.json
exclude tslint.json
exclude webpack.config.js

View file

@ -1 +1 @@
0.15.0.1
0.15.1.0

View file

@ -95,9 +95,8 @@ def main():
spec_path,
"--distpath",
distpath,
"--key",
"a5s1fe65aw41f54sa64v6b4ds98fhea98rhg4etj4et78ku4yu87mn",
]
],
check=True,
)
verify(binary_path, __version__)
generate_md5(binary_path, distpath / f"{binary_name}.md5")

View file

@ -8,7 +8,7 @@ import glob
nox.options.reuse_existing_virtualenvs = True
nox.options.sessions = ["tests", "lint", "docs"]
python = ["3.9"]
python = ["3.10"]
prettier_command = [
"npx",
@ -22,7 +22,7 @@ prettier_command = [
doc_dependencies = [".", "mkdocs", "mkdocs-material"]
lint_dependencies = [
"black==21.12b0",
"black==22.3.0",
"vulture",
"flake8",
"mypy==0.782",
@ -129,6 +129,7 @@ def serve(session):
@nox.session(reuse_venv=True)
def build(session):
"""Build python distribution (sdist and wheels)"""
session.install(*publish_deps)
session.run("rm", "-rf", "dist", "build", external=True)
session.run("yarn", external=True)
@ -136,6 +137,7 @@ def build(session):
session.run("python", "setup.py", "--quiet", "sdist", "bdist_wheel")
session.run("twine", "check", "dist/*")
for built_package in glob.glob("dist/*"):
# ensure we can install the built distributions
session.run("pip", "install", "--force-reinstall", built_package)
@ -160,49 +162,51 @@ def publish_docs(session):
session.run("mkdocs", "gh-deploy")
@nox.session(reuse_venv=True)
def build_executable_current_platform(session):
@nox.session(reuse_venv=True, python="3.10")
def build_executables_current_platform(session):
session.run("yarn", "install", external=True)
session.run("yarn", "build", external=True)
session.install(".", "PyInstaller>=4.5, <4.6")
session.install(".", "PyInstaller==5.1")
session.run("python", "make_executable.py")
session.notify("build_pex")
@nox.session(reuse_venv=True)
def build_executable_mac(session):
def build_executables_mac(session):
if not platform.startswith("darwin"):
raise Exception(f"Unexpected platform {platform}")
session.notify("build_executable_current_platform")
session.notify("build_executables_current_platform")
@nox.session(reuse_venv=True)
def build_executable_linux(session):
def build_executables_linux(session):
if not platform.startswith("linux"):
raise Exception(f"Unexpected platform {platform}")
session.notify("build_executable_current_platform")
session.notify("build_executables_current_platform")
@nox.session(reuse_venv=True)
def build_executable_windows(session):
if not platform.startswith("win32"):
raise Exception(f"Unexpected platform {platform}")
session.notify("build_executable_current_platform")
session.notify("build_executables_current_platform")
@nox.session(python=python)
@nox.session
def build_pex(session):
"""Builds a pex of gdbgui"""
# NOTE: frontend must be built before running this
session.install("pex==2.1.45")
session.install("pex==2.1.93")
pex_path = Path("build/executable/gdbgui.pex")
session.run(
"pex",
".",
"-c",
"--console-script",
"gdbgui",
"-o",
"--output-file",
str(pex_path),
"--sh-boot",
"--validate-entry-point",
external=True,
)
checksum = hashlib.md5(pex_path.read_bytes()).hexdigest()

View file

@ -60,7 +60,7 @@ setup(
},
zip_safe=False,
install_requires=distutils.text_file.TextFile(
filename="./requirements.in"
filename="./requirements.txt"
).readlines(),
classifiers=[
"Intended Audience :: Developers",