Skip to content

Instantly share code, notes, and snippets.

@dholth
Created April 19, 2022 15:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dholth/da296c2ef8da40de9165d6d5a0fe1fe2 to your computer and use it in GitHub Desktop.
Save dholth/da296c2ef8da40de9165d6d5a0fe1fe2 to your computer and use it in GitHub Desktop.
sample enscons pyproject.toml, SConstruct
[tool]
[tool.enscons]
name = "repodata-proxy"
version = "0.0.1"
author = "Daniel Holth"
author_email = "dholth@gmail.com"
src_root = ""
description = "Proxy to update repodata.json with little bandwidth"
install_requires = [
"appdirs",
"requests",
"requests-cache",
"jsonpatch"
]
keywords = ["packaging"]
license = "MIT"
url = "https://github.com/dholth/repodata-fly"
[build-system]
requires = ["pytoml>=0.1", "enscons"]
build-backend = "enscons.api"
# Starter SConstruct for enscons
# (filled by enscons.setup2toml)
import enscons
import pytoml as toml
metadata = dict(toml.load(open("pyproject.toml")))["tool"]["enscons"]
full_tag = "py3-none-any"
env = Environment(
tools=["default", "packaging", enscons.generate],
PACKAGE_METADATA=metadata,
WHEEL_TAG=full_tag,
)
# Only *.py is included automatically by setup2toml.
# Add extra 'purelib' files or package_data here.
py_source = []
lib = env.Whl("purelib", py_source, root="")
whl = env.WhlFile(lib)
# Add automatic source files, plus any other needed files.
sdist_source = FindSourceFiles() + ["PKG-INFO"]
sdist = env.SDist(source=sdist_source)
env.NoClean(sdist)
env.Alias("sdist", sdist)
develop = env.Command("#DEVELOP", enscons.egg_info_targets(env), enscons.develop)
env.Alias("develop", develop)
# needed for pep517 / enscons.api to work
env.Default(whl, sdist)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment