Skip to content

Commit

Permalink
The package can be compatible with both Python 2 and Python 3
Browse files Browse the repository at this point in the history
  • Loading branch information
haiiliin committed Jun 18, 2024
1 parent 88e630f commit 009b254
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
9 changes: 4 additions & 5 deletions binder/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import os
import sys
import subprocess
from pathlib import Path

try:
from ._version import __version__ as _default_version
Expand All @@ -24,13 +23,13 @@ def _get_version():
# Only shell out to a git subprocess if really needed, and not on a
# shallow clone, such as those used by CI, as the latter would trigger
# a warning from setuptools_scm.
root = Path(__file__).resolve().parents[1]
if (root / ".git").exists() and not (root / ".git/shallow").exists():
root = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
if os.path.exists(os.path.join(root, ".git")) and not os.path.exists(os.path.join(root, ".git/shallow")):
try:
import setuptools_scm

return setuptools_scm.get_version(
root=str(root),
root=root,
version_scheme="post-release",
fallback_version=_default_version,
)
Expand All @@ -40,4 +39,4 @@ def _get_version():
return _default_version


__version__: str = _get_version()
__version__ = _get_version()
14 changes: 12 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,17 @@ authors = [
]
classifiers = [
"Programming Language :: Python",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.0",
"Programming Language :: Python :: 3.1",
"Programming Language :: Python :: 3.2",
"Programming Language :: Python :: 3.3",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
Expand All @@ -21,7 +31,7 @@ classifiers = [
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
]
requires-python = ">=3.8"
requires-python = ">=2.7"

[project.urls]
Homepage = "https://github.com/RosettaCommons/binder/"
Expand Down Expand Up @@ -52,7 +62,7 @@ cmake.define.LLVM_ENABLE_PROJECTS = "clang"

# Wheel configuration
wheel.packages = ["binder"]
wheel.py-api = "py3"
wheel.py-api = "py2.py3"
wheel.expand-macos-universal-tags = true

[tool.cibuildwheel]
Expand Down

0 comments on commit 009b254

Please sign in to comment.