Skip to content

Commit 80b011f

Browse files
emlowealtendky
andauthored
Add python 3.12 (#110)
* Add python 3.12 --------- Co-authored-by: Kyle Altendorf <[email protected]>
1 parent 326086c commit 80b011f

File tree

4 files changed

+22
-14
lines changed

4 files changed

+22
-14
lines changed

.github/workflows/main.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
fail-fast: false
2020
matrix:
2121
os: [macos-latest, ubuntu-latest, windows-latest]
22-
python-version: [ '3.8', '3.9', '3.10', '3.11' ]
22+
python-version: [ '3.8', '3.9', '3.10', '3.11', '3.12' ]
2323
name: Python ${{ matrix.os }} ${{ matrix.python-version }} sample
2424
steps:
2525
- uses: actions/checkout@v3
@@ -31,8 +31,7 @@ jobs:
3131
- name: Install dependencies
3232
run: |
3333
python -m pip install --upgrade pip
34-
python -m pip install .
34+
python -m pip install .[dev]
3535
- name: Test with pytest
3636
run: |
37-
python -m pip install pytest
38-
py.test tests
37+
pytest tests

clvm_tools/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
from pkg_resources import get_distribution, DistributionNotFound
1+
import importlib_metadata
22

33
try:
4-
__version__ = get_distribution(__name__).version
5-
except DistributionNotFound:
4+
__version__ = importlib_metadata.version(__name__)
5+
except importlib_metadata.PackageNotFoundError:
66
# package is not installed
77
__version__ = "unknown"

setup.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77

88
dependencies = [
99
"clvm>=0.9.2",
10-
"clvm_tools_rs>=0.1.37"
10+
"clvm_tools_rs>=0.1.37",
11+
"importlib_metadata",
12+
"setuptools",
1113
]
1214

1315
dev_dependencies = [
@@ -16,7 +18,13 @@
1618

1719
setup(
1820
name="clvm_tools",
19-
packages=["ir", "clvm_tools", "clvm_tools.setuptools", "stages", "stages.stage_2",],
21+
packages=[
22+
"ir",
23+
"clvm_tools",
24+
"clvm_tools.setuptools",
25+
"stages",
26+
"stages.stage_2",
27+
],
2028
author="Chia Network, Inc.",
2129
entry_points={
2230
"console_scripts": [
@@ -45,7 +53,9 @@
4553
"License :: OSI Approved :: Apache Software License",
4654
"Topic :: Security :: Cryptography",
4755
],
48-
extras_require=dict(dev=dev_dependencies,),
56+
extras_require=dict(
57+
dev=dev_dependencies,
58+
),
4959
project_urls={
5060
"Bug Reports": "https://github.com/Chia-Network/clvm_tools",
5161
"Source": "https://github.com/Chia-Network/clvm_tools",

tests/cmds_test.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import io
22
import os
3-
import pkg_resources
43
import shlex
54
import sys
65
import unittest
76

7+
import importlib_metadata
88

99
# If the REPAIR environment variable is set, any tests failing due to
1010
# wrong output will be corrected. Be sure to do a "git diff" to validate that
@@ -57,9 +57,8 @@ def invoke_tool(self, cmd_line):
5757
sys.stderr = stderr_buffer
5858

5959
args = shlex.split(cmd_line)
60-
v = pkg_resources.load_entry_point("clvm_tools", "console_scripts", args[0])(
61-
args
62-
)
60+
[entry_point] = importlib_metadata.entry_points(group="console_scripts", name=args[0])
61+
v = entry_point.load()(args)
6362

6463
sys.stdout = old_stdout
6564
sys.stderr = old_stderr

0 commit comments

Comments
 (0)