Skip to content

Commit

Permalink
Add python 3.12 (#110)
Browse files Browse the repository at this point in the history
* Add python 3.12
---------

Co-authored-by: Kyle Altendorf <[email protected]>
  • Loading branch information
emlowe and altendky authored Mar 6, 2024
1 parent 326086c commit 80b011f
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 14 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
python-version: [ '3.8', '3.9', '3.10', '3.11' ]
python-version: [ '3.8', '3.9', '3.10', '3.11', '3.12' ]
name: Python ${{ matrix.os }} ${{ matrix.python-version }} sample
steps:
- uses: actions/checkout@v3
Expand All @@ -31,8 +31,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install .
python -m pip install .[dev]
- name: Test with pytest
run: |
python -m pip install pytest
py.test tests
pytest tests
6 changes: 3 additions & 3 deletions clvm_tools/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from pkg_resources import get_distribution, DistributionNotFound
import importlib_metadata

try:
__version__ = get_distribution(__name__).version
except DistributionNotFound:
__version__ = importlib_metadata.version(__name__)
except importlib_metadata.PackageNotFoundError:
# package is not installed
__version__ = "unknown"
16 changes: 13 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@

dependencies = [
"clvm>=0.9.2",
"clvm_tools_rs>=0.1.37"
"clvm_tools_rs>=0.1.37",
"importlib_metadata",
"setuptools",
]

dev_dependencies = [
Expand All @@ -16,7 +18,13 @@

setup(
name="clvm_tools",
packages=["ir", "clvm_tools", "clvm_tools.setuptools", "stages", "stages.stage_2",],
packages=[
"ir",
"clvm_tools",
"clvm_tools.setuptools",
"stages",
"stages.stage_2",
],
author="Chia Network, Inc.",
entry_points={
"console_scripts": [
Expand Down Expand Up @@ -45,7 +53,9 @@
"License :: OSI Approved :: Apache Software License",
"Topic :: Security :: Cryptography",
],
extras_require=dict(dev=dev_dependencies,),
extras_require=dict(
dev=dev_dependencies,
),
project_urls={
"Bug Reports": "https://github.com/Chia-Network/clvm_tools",
"Source": "https://github.com/Chia-Network/clvm_tools",
Expand Down
7 changes: 3 additions & 4 deletions tests/cmds_test.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import io
import os
import pkg_resources
import shlex
import sys
import unittest

import importlib_metadata

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

args = shlex.split(cmd_line)
v = pkg_resources.load_entry_point("clvm_tools", "console_scripts", args[0])(
args
)
[entry_point] = importlib_metadata.entry_points(group="console_scripts", name=args[0])
v = entry_point.load()(args)

sys.stdout = old_stdout
sys.stderr = old_stderr
Expand Down

0 comments on commit 80b011f

Please sign in to comment.