Skip to content

Commit 5415408

Browse files
committed
Update build & test scripts
Drop older python versions reorg to src based directory structure
1 parent ec468a2 commit 5415408

File tree

19 files changed

+223
-709
lines changed

19 files changed

+223
-709
lines changed

.github/workflows/build.yml

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ jobs:
2222
- name: Set up Python
2323
uses: actions/setup-python@v4
2424
with:
25-
python-version: "3.10"
25+
python-version: "3.13"
2626

2727
- name: Install dependencies
2828
run: |
29-
python -m pip install -U pylint
29+
python -m pip install -r test/requirements.txt
3030
3131
- name: Install
3232
run: |
@@ -36,10 +36,33 @@ jobs:
3636
run: |
3737
pylint --rcfile test/pylint.rc gitmetheurl
3838
39+
#-------------------------------------------------------------------------------
40+
mypy:
41+
runs-on: ubuntu-latest
42+
steps:
43+
- uses: actions/checkout@v3
44+
- name: Set up Python
45+
uses: actions/setup-python@v4
46+
with:
47+
python-version: "3.13"
48+
49+
- name: Install dependencies
50+
run: |
51+
python -m pip install -r test/requirements.txt
52+
53+
- name: Install
54+
run: |
55+
python -m pip install "."
56+
57+
- name: Type Check
58+
run: |
59+
mypy --config-file test/mypy.ini src/gitmetheurl
60+
3961
#-------------------------------------------------------------------------------
4062
build:
4163
needs:
4264
- lint
65+
- mypy
4366
name: Build distributions
4467
runs-on: ubuntu-latest
4568
steps:
@@ -48,17 +71,18 @@ jobs:
4871
- uses: actions/setup-python@v4
4972
name: Install Python
5073
with:
51-
python-version: "3.10"
74+
python-version: "3.13"
5275

5376
- name: Install dependencies
5477
run: |
55-
python -m pip install -U build
78+
python -m pip install build
5679
5780
- name: Build
5881
run: python -m build
5982

60-
- uses: actions/upload-artifact@v3
83+
- uses: actions/upload-artifact@v4
6184
with:
85+
name: dist
6286
path: |
6387
dist/*.tar.gz
6488
dist/*.whl
@@ -76,9 +100,9 @@ jobs:
76100
# Only publish when a GitHub Release is created.
77101
if: github.event_name == 'release'
78102
steps:
79-
- uses: actions/download-artifact@v3
103+
- uses: actions/download-artifact@v4
80104
with:
81-
name: artifact
105+
name: dist
82106
path: dist
83107

84108
- uses: pypa/gh-action-pypi-publish@release/v1

LICENSE

Lines changed: 159 additions & 668 deletions
Large diffs are not rendered by default.

gitmetheurl/__about__.py

Lines changed: 0 additions & 1 deletion
This file was deleted.

pyproject.toml

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta"
55
[project]
66
name = "git-me-the-url"
77
dynamic = ["version"]
8-
requires-python = ">=3.5"
8+
requires-python = ">=3.7"
99
dependencies = [
1010
"gitpython",
1111
]
@@ -15,22 +15,14 @@ authors = [
1515
]
1616
description = "Generate sharable links to your Git source"
1717
readme = "README.md"
18-
license = {file = "LICENSE"}
18+
license = {text = "LGPLv3"}
1919
classifiers = [
2020
"Development Status :: 5 - Production/Stable",
2121
"Programming Language :: Python",
2222
"Programming Language :: Python :: 3",
23-
"Programming Language :: Python :: 3.5",
24-
"Programming Language :: Python :: 3.6",
25-
"Programming Language :: Python :: 3.7",
26-
"Programming Language :: Python :: 3.8",
27-
"Programming Language :: Python :: 3.9",
28-
"Programming Language :: Python :: 3.10",
29-
"Programming Language :: Python :: 3.11",
30-
"Programming Language :: Python :: 3.12",
3123
"Programming Language :: Python :: 3 :: Only",
3224
"Intended Audience :: Developers",
33-
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
25+
"License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)",
3426
"Operating System :: OS Independent",
3527
"Topic :: Software Development :: Version Control :: Git",
3628
]

src/gitmetheurl/__about__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
version_info = (2, 2, 0)
2+
__version__ = ".".join([str(n) for n in version_info])
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,7 @@
55

66
from .base import GitMeTheURL, GMTUException
77
from .translators import TranslatorSpec
8+
9+
__all__ = (
10+
"GitMeTheURL", "GMTUException", "TranslatorSpec",
11+
)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def get_source_url(self, path: str, line: "Optional[Union[int, Tuple[int, int]]]
5858
# Lookup translator
5959
translator = self._lookup_translator(remote)
6060
if translator is None:
61-
raise GMTUException("Unable to convert remote: %s" % remote)
61+
raise GMTUException(f"Unable to convert remote: {remote}")
6262

6363
# Construct the URL!
6464
return translator.get_source_url(remote, info)
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,10 @@ def main() -> None:
5353
try:
5454
url = gmtu.get_source_url(path, line=line, exact_commit=options.exact_commit)
5555
except git.InvalidGitRepositoryError:
56-
print("error: Path does not point to a git repository: %s" % path, file=sys.stderr)
56+
print("error: Path does not point to a git repository:", path, file=sys.stderr)
5757
sys.exit(1)
5858
except git.NoSuchPathError:
59-
print("error: Path does not exist: %s" % path, file=sys.stderr)
59+
print("error: Path does not exist:", path, file=sys.stderr)
6060
sys.exit(1)
6161
except GMTUException as e:
6262
print("error:", e.args[0], file=sys.stderr)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def _get_entry_points(group_name: str) -> List['EntryPoint']:
2525
return eps
2626

2727
else:
28-
import pkg_resources # type: ignore
28+
import pkg_resources
2929

3030
def _get_entry_points(group_name: str) -> List['EntryPoint']:
3131
eps = []

0 commit comments

Comments
 (0)