Skip to content

Commit

Permalink
updated github workflow action to use python3
Browse files Browse the repository at this point in the history
  • Loading branch information
Sanjeev Kumar committed Dec 7, 2023
1 parent 7ac71e4 commit c4fa8c5
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 125 deletions.
17 changes: 14 additions & 3 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,33 @@ permissions:
jobs:
build-n-publish:
name: Build and publish Python 🐍 distributions 📦 to PyPI
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Set up Python 3.7
uses: actions/setup-python@v1
with:
python-version: 3.7

- name: remove old pip
run: sudo apt remove python-pip

- name: wget get-pip.py
run: wget https://bootstrap.pypa.io/get-pip.py

- name: install pip
run: python3 get-pip.py

- name: Install pypa/build
run: >-
python -m
python3 -m
pip install
build
--user
- name: Build a binary wheel and a source tarball
run: >-
python -m
python3 -m
build
--sdist
--wheel
Expand Down
32 changes: 17 additions & 15 deletions ez_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,10 @@ def _validate_md5(egg_name, data):
if egg_name in md5_data:
digest = md5(data).hexdigest()
if digest != md5_data[egg_name]:
print >>sys.stderr, (
print(
"md5 validation of %s failed! (Possible download problem?)"
% egg_name
% egg_name,
file=sys.stderr
)
sys.exit(2)
return data
Expand Down Expand Up @@ -103,14 +104,14 @@ def do_download():
return do_download()
try:
pkg_resources.require("setuptools>="+version); return
except pkg_resources.VersionConflict, e:
except pkg_resources.VersionConflict as e:
if was_imported:
print >>sys.stderr, (
"The required version of setuptools (>=%s) is not available, and\n"
"can't be installed while this script is running. Please install\n"
" a more recent version first, using 'easy_install -U setuptools'."
"\n\n(Currently using %r)"
) % (version, e.args[0])
print((
"The required version of setuptools (>=%s) is not available, and\n"
"can't be installed while this script is running. Please install\n"
"a more recent version first, using 'easy_install -U setuptools'."
"\n\n(Currently using %r)"
) % (version, e.args[0]), file=sys.stderr)
sys.exit(2)
except pkg_resources.DistributionNotFound:
pass
Expand Down Expand Up @@ -159,7 +160,7 @@ def download_setuptools(
# Read/write all in one block, so we don't create a corrupt file
# if the download is interrupted.
data = _validate_md5(egg_name, src.read())
dst = open(saveto,"wb"); dst.write(data)
dst = open(saveto, "wb"); dst.write(data)
finally:
if src: src.close()
if dst: dst.close()
Expand Down Expand Up @@ -216,13 +217,14 @@ def main(argv, version=DEFAULT_VERSION):
os.unlink(egg)
else:
if setuptools.__version__ == '0.0.1':
print >>sys.stderr, (
msg = (
"You have an obsolete version of setuptools installed. Please\n"
"remove it from your system entirely before rerunning this script."
)
print(msg, file=sys.stderr)
sys.exit(2)

req = "setuptools>="+version
req = "setuptools>=" + version
import pkg_resources
try:
pkg_resources.require(req)
Expand All @@ -238,8 +240,8 @@ def main(argv, version=DEFAULT_VERSION):
from setuptools.command.easy_install import main
main(argv)
else:
print "Setuptools version",version,"or greater has been installed."
print '(Run "ez_setup.py -U setuptools" to reinstall or upgrade.)'
print("Setuptools version",version,"or greater has been installed.")
print('Run "ez_setup.py -U setuptools" to reinstall or upgrade.')

def update_md5(filenames):
"""Update our built-in md5 registry"""
Expand All @@ -262,7 +264,7 @@ def update_md5(filenames):

match = re.search("\nmd5_data = {\n([^}]+)}", src)
if not match:
print >>sys.stderr, "Internal error!"
print("Internal error!", file=sys.stderr)
sys.exit(2)

src = src[:match.start(1)] + repl + src[match.end(1):]
Expand Down
83 changes: 0 additions & 83 deletions maildiff.egg-info/PKG-INFO

This file was deleted.

16 changes: 0 additions & 16 deletions maildiff.egg-info/SOURCES.txt

This file was deleted.

1 change: 0 additions & 1 deletion maildiff.egg-info/dependency_links.txt

This file was deleted.

3 changes: 0 additions & 3 deletions maildiff.egg-info/entry_points.txt

This file was deleted.

2 changes: 0 additions & 2 deletions maildiff.egg-info/requires.txt

This file was deleted.

2 changes: 0 additions & 2 deletions maildiff.egg-info/top_level.txt

This file was deleted.

0 comments on commit c4fa8c5

Please sign in to comment.