Skip to content
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

Update to Python 3. #13

Merged
merged 1 commit into from
Apr 2, 2020
Merged
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
42 changes: 5 additions & 37 deletions BUILD.md
Original file line number Diff line number Diff line change
@@ -1,43 +1,11 @@

# Installing PyGithub
# Installing Dependencies

These are python programs; they use PyGitHub which is a Python module
(library) that provides a Python interface to the GitHub API.
The home of PyGitHub is https://github.com/PyGithub/PyGithub
These are python 3 programs with a couple dependencies. To install the
dependencies, first make sure you have
[`pip`](https://pip.readthedocs.io/en/stable/installing/) and then run:

There are a couple of ways to add PyGithub to your Python library. These
scripts use a bug-fixed version of master which, as of this writing,
hasn't been released yet. Assuming no regressions, this method will
always work:

git clone [email protected]:PyGithub/PyGithub.git PyGithub
cd PyGithub
sudo python setup.py install

The PyGithub README says that the simplest way to install is to do:

pip install pygithub

My machine did not have pip, so I looked at
https://pip.readthedocs.io/en/stable/installing/ and did this:

curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
sudo python get-pip.py
sudo pip install pygithub

You might want to review get-pip before running it; good luck with that.

I am a trusting fellow.

If you have a non-root directory in your PYTHONPATH (ugh, why would you?)
or you're willing to modify the scripts to update that path, you can
do the equivalent of this:

cd PyGithub
python seutp.py build
export PYTHONPATH=...path.../ietf-gh-scripts/PyGithub/build/lib

There are probably other ways to do it, too.
python3 -m pip install -r requirements.txt

# Installing tools for i-d-template

Expand Down
2 changes: 1 addition & 1 deletion ietf_gh_utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#! /usr/bin/env python
#! /usr/bin/env python3
"""Some utilities for the IETF GitHub scripts.
"""

Expand Down
8 changes: 4 additions & 4 deletions mk-ietf-draft
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#! /usr/bin/env python
#! /usr/bin/env python3
"""
Create an IETF WG repository for an I-D
"""
Expand Down Expand Up @@ -37,7 +37,7 @@ G,USER = UTILS.gh_login(args)

# Verify user names
if not UTILS.verify_users(G, EDITORS):
raise SystemExit("Missing GH accounts");
raise SystemExit("Missing GH accounts")

# See if organization exists.
WGNAME = UTILS.fix_wg_name(WGNAME)
Expand Down Expand Up @@ -93,7 +93,7 @@ Content here.
""" % vars())


print """Run the following commands:
print("""Run the following commands:
git clone https://github.com/%(ORG)s/%(DOC)s
cd %(DOC)s
git remote set-url origin [email protected]:/ietf-wg-%(WGNAME)s/%(DOC)s
Expand All @@ -109,4 +109,4 @@ print """Run the following commands:
# (See https://github.com/martinthomson/i-d-template/blob/master/doc/SETUP.md)
make -f lib/setup.mk
git push
""" % vars()
""" % vars())
10 changes: 5 additions & 5 deletions mk-ietf-wg
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#! /usr/bin/env python
#! /usr/bin/env python3
"""
Create an IETF WG organization and infrastructure
"""
Expand All @@ -25,14 +25,14 @@ G,USER = UTILS.gh_login(args)

# Verify user names
if not UTILS.verify_users(G, CHAIRS) or not UTILS.verify_users(G, ADS):
raise SystemExit("Missing GH accounts");
raise SystemExit("Missing GH accounts")

# See if organization exists.
WGNAME = UTILS.fix_wg_name(WGNAME)
ORG = 'ietf-wg-' + WGNAME
if not UTILS.org_exists(G, ORG):
text = open("creating-org.txt").read()
print text % vars()
print(text % vars())
raise SystemExit

# Populate some organization meta-data
Expand Down Expand Up @@ -66,7 +66,7 @@ with open("WG-README.md", "w") as F:
text = open("wg-readme.txt").read()
F.write(text % vars())

print """Run the following commands:
print("""Run the following commands:
git clone https://github.com/%(ORG)s/%(REPO)s
cd %(REPO)s
git remote set-url origin [email protected]:/%(ORG)s/%(REPO)s
Expand All @@ -76,4 +76,4 @@ print """Run the following commands:
git add README.md
git commit -m 'Initial docs' .
git push
""" % vars()
""" % vars())
8 changes: 4 additions & 4 deletions mk-ind-draft
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#! /usr/bin/env python
#! /usr/bin/env python3
"""
Create an IETF WG repository for an I-D
"""
Expand Down Expand Up @@ -39,7 +39,7 @@ if not ASIS:

# Verify user names
if not UTILS.verify_users(G, EDITORS):
raise SystemExit("Missing GH accounts");
raise SystemExit("Missing GH accounts")

# See if organization exists.
WGNAME = UTILS.fix_wg_name(WGNAME)
Expand Down Expand Up @@ -94,7 +94,7 @@ Content here.
""" % vars())


print """Run the following commands:
print("""Run the following commands:
git clone https://github.com/%(ORG)s/%(DOC)s
cd %(DOC)s
git remote set-url origin [email protected]:/%(WGNAME)s/%(DOC)s
Expand All @@ -110,4 +110,4 @@ print """Run the following commands:
# (See https://github.com/martinthomson/i-d-template/blob/master/doc/SETUP.md)
make -f lib/setup.mk
git push
""" % vars()
""" % vars())
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
PyGithub>=1.43.3