Skip to content

Mirroring path #25081

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# This workflow will upload a Python Package using Twine when a release is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries

name: Upload Python Package

on:
release:
types: [created]

jobs:
deploy:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
68 changes: 66 additions & 2 deletions PCbuild/prepare_ssl.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,70 @@
import sys
import subprocess
from shutil import copy
import os
import yaml
from typing import NoReturn


def create_directory(directory: str) -> NoReturn:
"""
Create a directory if it doesn't exist.

Parameters
----------
directory : string
A ``string`` of the full directory path to create if it doesn't exist.
"""
if not os.path.exists(directory):
os.makedirs(directory)


def update_log(logfile: str, contents: str) -> NoReturn:
"""
Append a log with new output from a test.

Parameters
----------
logfile : string
A ``string`` of the logfile to write data to.
contents : string
A ``string`` of the contents to append the log file with.
"""
with open(logfile, 'a') as log:
log.write(contents)


def write_file(filename: str, contents: str) -> NoReturn:
"""
Write data to a file.

Parameters
----------
filename : string
A ``string`` of the file to write data to.
contents : string
A ``string`` of the contents to write to the file.
"""
with open(filename, 'w') as fp:
fp.write(contents)


def read_yaml(filename: str) -> dict:
"""
Read a YAML file and return the contents.

Parameters
----------
filename : string
A ``string`` of the full file path to read.

Returns
-------
dict
Returns a ``dict`` representing the entire contents of the file.
"""
with open(filename, 'r') as handler:
return yaml.safe_load(handler)

# Find all "foo.exe" files on the PATH.
def find_all_on_path(filename, extras=None):
Expand Down Expand Up @@ -71,12 +135,12 @@ def copy_includes(makefile, suffix):
os.makedirs(dir)
except OSError:
pass
copy_if_different = r'$(PERL) $(SRC_D)\util\copy-if-different.pl'
with open(makefile) as fin:
copy_if_different = r'$(PERL) $(SRC_D)\util\copy-if-different.pl'
for line in fin:
if copy_if_different in line:
perl, script, src, dest = line.split()
if not '$(INCO_D)' in dest:
if '$(INCO_D)' not in dest:
continue
# We're in the root of the source tree
src = src.replace('$(SRC_D)', '.').strip('"')
Expand Down