Skip to content

Commit 5f62d71

Browse files
authored
Merge branch 'main' into Replace-pkg_resources-with-import-importlib.resources
2 parents 6f5f063 + b8baa82 commit 5f62d71

4 files changed

Lines changed: 49 additions & 24 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
runs-on: ubuntu-latest
88
strategy:
99
matrix:
10-
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
10+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13.0-rc.2"]
1111

1212
steps:
1313
- uses: actions/checkout@v4
@@ -25,25 +25,3 @@ jobs:
2525
name: junit-${{ matrix.python-version }}
2626
path: junit/*
2727

28-
report:
29-
runs-on: ubuntu-latest
30-
needs: test
31-
permissions:
32-
pull-requests: write
33-
steps:
34-
- uses: actions/download-artifact@v4
35-
- name: Publish Test Reports
36-
uses: EnricoMi/publish-unit-test-result-action/composite@v2
37-
if: always()
38-
with:
39-
files: junit-*/test-results-*.xml
40-
- name: Create Coverage Report
41-
uses: irongut/CodeCoverageSummary@v1.3.0
42-
with:
43-
filename: junit-*/coverage-*.xml
44-
format: markdown
45-
output: both
46-
- name: Add coverage PR comment
47-
uses: marocchino/sticky-pull-request-comment@v2
48-
with:
49-
path: code-coverage-results.md

.github/workflows/test-report.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: 'Test Report'
2+
on:
3+
workflow_run:
4+
workflows: ['Continous Integration']
5+
types:
6+
- completed
7+
permissions:
8+
contents: read
9+
actions: read
10+
checks: write
11+
pull-requests: write
12+
jobs:
13+
report:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/download-artifact@v4
17+
- name: Publish Test Reports
18+
uses: EnricoMi/publish-unit-test-result-action/composite@v2
19+
if: always()
20+
with:
21+
files: junit-*/test-results-*.xml
22+
- name: Create Coverage Report
23+
uses: irongut/CodeCoverageSummary@v1.3.0
24+
with:
25+
filename: junit-*/coverage-*.xml
26+
format: markdown
27+
output: both
28+
- name: Add coverage PR comment
29+
uses: marocchino/sticky-pull-request-comment@v2
30+
with:
31+
path: code-coverage-results.md

langcodes/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1501,7 +1501,7 @@ def __eq__(self, other):
15011501
return self._str_tag == other._str_tag
15021502

15031503
def __hash__(self) -> int:
1504-
return hash(id(self))
1504+
return hash(self._str_tag)
15051505

15061506
def __getitem__(self, key: str) -> Optional[Union[str, List[str]]]:
15071507
if key in self.ATTRIBUTES:

langcodes/tests/test_language.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
from langcodes import Language
2+
3+
4+
def test__hash__():
5+
en1 = Language.get("en")
6+
# Disable caching
7+
Language._INSTANCES = {}
8+
Language._PARSE_CACHE = {}
9+
en2 = Language.get("en")
10+
assert hash(en1) == hash(en2)
11+
12+
# Again, disable caching
13+
Language._INSTANCES = {}
14+
Language._PARSE_CACHE = {}
15+
en_us = Language.get("en-US")
16+
assert hash(en1) != hash(en_us)

0 commit comments

Comments
 (0)