forked from richardkiss/hsms
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSConstruct
42 lines (33 loc) · 1.13 KB
/
SConstruct
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# Starter SConstruct for enscons
import enscons
import setuptools_scm
import pytoml
metadata = dict(pytoml.load(open("pyproject.toml")))["tool"]["enscons"]
metadata["version"] = setuptools_scm.get_version(local_scheme="no-local-version")
full_tag = "py3-none-any" # pure Python packages compatible with 2+3
env = Environment(
tools=["default", "packaging", enscons.generate],
PACKAGE_METADATA=metadata,
WHEEL_TAG=full_tag,
ROOT_IS_PURELIB=full_tag.endswith("-any"),
)
# Only *.py is included automatically by setup2toml.
# Add extra 'purelib' files or package_data here.
py_source = (
Glob("hsms/*.py")
+ Glob("hsms/*/*.py")
+ Glob("hsms/puzzles/*cl")
+ Glob("hsms/puzzles/*clvm")
)
source = env.Whl("purelib", py_source, root="")
whl = env.WhlFile(source=source)
# It's easier to just use Glob() instead of FindSourceFiles() since we have
# so few installed files..
sdist_source = (
File(["PKG-INFO", "README.md", "SConstruct", "pyproject.toml"]) + py_source
)
sdist = env.SDist(source=sdist_source)
env.NoClean(sdist)
env.Alias("sdist", sdist)
# needed for pep517 (enscons.api) to work
env.Default(whl, sdist)