Skip to content

Commit

Permalink
Merge pull request #224 from openpreserve/dev/switch-to-pyproject
Browse files Browse the repository at this point in the history
Basic update to Python 3
  • Loading branch information
carlwilson authored Sep 11, 2024
2 parents 33789ab + 295ba36 commit 54cb23f
Show file tree
Hide file tree
Showing 19 changed files with 847 additions and 613 deletions.
File renamed without changes.
File renamed without changes.
2 changes: 2 additions & 0 deletions fido/pronom/http.py → .attic/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
"""
from six.moves import urllib

# NOTE: from fido/pronom/


def get_sig_xml_for_puid(puid):
"""Return the full PRONOM signature XML for the passed PUID."""
Expand Down
File renamed without changes.
0 setup.py → .attic/setup.py
100755 → 100644
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions .github/workflows/test-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:

strategy:
matrix:
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"]
python-version: ["3.8", "3.9", "3.10"]

steps:
- uses: actions/checkout@v3
Expand All @@ -25,7 +25,7 @@ jobs:
pip install -U flake8 pep257 pytest-cov codecov codacy-coverage pluggy
pip install -e .
- name: Lint code with flake8
run: flake8 . --count --show-source --max-line-length=127 --statistics
run: flake8 . --count --show-source --ignore=E231,E241,E501,W503,E203 --max-line-length=127 --statistics
- name: Lint code with pep257
if: matrix.python-version == 2.7
run: pep257 --match="(?!fido).*\.py" ./fido
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
*.egg-info
*.py[co]
.venv/

/MANIFEST
/dist
Expand All @@ -8,6 +9,9 @@
/.eggs
.coverage
.env/
.pytest_cache/
.ruff_cache
__pycache__/

/fmtinfo.csv
/exp
Expand Down
Empty file added VERSION
Empty file.
40 changes: 3 additions & 37 deletions fido/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,43 +7,9 @@
It is designed for simple integration into automated work-flows.
"""

from __future__ import print_function
__version__ = "1.8.0dev"

# todo: move this to a conf/conf.py or something rather than init.py. Would require some cascading updates, though
from os.path import abspath, dirname, join

from six.moves import input as rinput


__version__ = '1.6.1'


CONFIG_DIR = join(abspath(dirname(__file__)), 'conf')


def query_yes_no(question, default='yes'):
"""
Ask a yes/no question via input() and return their answer.
`question` is a string that is presented to the user. `default` is the
presumed answer if the user just hits <Enter>. It must be "yes" (the
default), "no" or None (meaning an answer is required of the user).
The "answer" return value is True for "yes" or False for "no".
"""
valid = {'yes': True, 'y': True, 'no': False, 'n': False}
if default is None:
prompt = ' [y/n] '
elif default == 'yes':
prompt = ' [Y/n] '
elif default == 'no':
prompt = ' [y/N] '
else:
raise ValueError('Invalid default answer: "%s"' % default)
while True:
print(question + prompt, end='')
choice = rinput().lower()
if default is not None and choice == '':
return valid[default]
if choice in valid:
return valid[choice]
print('Please respond with "yes" or "no" (or "y" or "n").')
CONFIG_DIR = join(abspath(dirname(__file__)), "conf")
Loading

0 comments on commit 54cb23f

Please sign in to comment.