Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 175a8fa

Browse files
authored
refactor: add support for Python 3.10 (#111)
* Add support for Python 3.10 * Upgrade Python syntax with pyupgrade --py37-plus
1 parent c3da6c8 commit 175a8fa

5 files changed

Lines changed: 8 additions & 7 deletions

File tree

.github/workflows/ci-workflow.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ jobs:
1212
runs-on: ${{ matrix.os }}
1313
strategy:
1414
matrix:
15-
python-version: [3.7, 3.8, 3.9]
15+
python-version: ["3.7", "3.8", "3.9", "3.10"]
1616
os: [ubuntu-latest, macos-latest, windows-latest]
1717

1818
steps:
19-
- uses: actions/checkout@v2
19+
- uses: actions/checkout@v3
2020
- name: Set up Python ${{ matrix.python-version }}
21-
uses: actions/setup-python@v2
21+
uses: actions/setup-python@v4
2222
with:
2323
python-version: ${{ matrix.python-version }}
2424
- name: Install dependencies

PyGitUp/gitup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ def rebase_all_branches(self):
290290
# we get a detached head after doing our rebase *confused*.
291291
# Running self.repo.active_branch would fail.
292292
or not self.repo.active_branch.name == original_branch.name):
293-
print(colored('returning to {}'.format(original_branch.name),
293+
print(colored(f'returning to {original_branch.name}',
294294
'magenta'))
295295
original_branch.checkout()
296296

@@ -470,7 +470,7 @@ def load_config(self):
470470

471471
def config(self, key):
472472
""" Get a git-up-specific config value. """
473-
return self.git.config('git-up.{}'.format(key))
473+
return self.git.config(f'git-up.{key}')
474474

475475
def is_prune(self):
476476
"""

PyGitUp/tests/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def update_file(repo, commit_message='', counter=[0], filename=testfile_name):
5757
counter[0] += 1 # See: http://stackoverflow.com/a/279592/997063
5858

5959
path_file = join(repo.working_dir, filename)
60-
contents = 'line 1\nline 2\ncounter: {}'.format(counter[0])
60+
contents = f'line 1\nline 2\ncounter: {counter[0]}'
6161
write_file(path_file, contents)
6262

6363
repo.index.add([path_file])

PyGitUp/tests/test_separate_worktree.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
test_name = 'worktree'
1111
repo_path = join(basepath, test_name + os.sep)
12-
worktree_dir = '{}_worktree'.format(test_name)
12+
worktree_dir = f'{test_name}_worktree'
1313
worktree_path = join(basepath, worktree_dir)
1414

1515

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ classifiers = [
2222
"Programming Language :: Python :: 3.7",
2323
"Programming Language :: Python :: 3.8",
2424
"Programming Language :: Python :: 3.9",
25+
"Programming Language :: Python :: 3.10",
2526
"Topic :: Software Development :: Version Control",
2627
"Topic :: Utilities",
2728
]

0 commit comments

Comments
 (0)