Skip to main content

scons-tool-kpsewhich

PyPi package version Travis CI build status https://ci.appveyor.com/api/projects/status/github/ptomulik/scons-tool-kpsewhich?svg=true

This tool provides SCons with interface to kpsewhich utility. The kpsewhich program is a part of kpathsea library, which in turn is a part of TeX Live distribution. Its purpose is to search within the TeX directory structure (TDS) for files such as TeX classes, styles, BibTeX databases, fonts etc. For more informations see kpathsea manual and informations about TeX directory structure (TDS).

This tool appends new methods to the SCons Environment. It does not provide any builders, but rather equips SCons Environment with methods that call kpsewhich program during the SConscript-reading phase. This tool does not produce any files, it is thought as an extension for obtaining textual information from external program.

INSTALLATION

There are few ways to install this tool for your project.

From pypi

This method may be preferable if you build your project under a virtualenv. To add kpsewhich tool from pypi, type (within your wirtualenv):

pip install scons-tool-loader scons-tool-kpsewhich

or, if your project uses pipenv:

pipenv install --dev scons-tool-loader scons-tool-kpsewhich

Alternatively, you may add this to your Pipfile

[dev-packages]
scons-tool-loader = "*"
scons-tool-kpsewhich = "*"

The tool will be installed as a namespaced package sconstool.kpsewhich in project’s virtual environment. You may further use scons-tool-loader to load the tool.

As a git submodule

  1. Create new git repository:

    mkdir /tmp/prj && cd /tmp/prj
    touch README.rst
    git init
  2. Add the scons-tool-kpsewhich as a submodule:

    git submodule add git://github.com/ptomulik/scons-tool-kpsewhich.git site_scons/site_tools/kpsewhich
  3. For python 2.x create __init__.py in site_tools directory:

    touch site_scons/site_tools/__init__.py

    this will allow to directly import site_tools.kpsewhich (this may be required by other tools).

USAGE EXAMPLES

Find files article.cls and amsmath.sty used by latex:

env = Environment(tools = ['tex', 'kpsewhich'])
files = env.KPSFindFiles(['article.cls','amsmath.sty'], progname='$LATEX')

Find all occurrences of unicode.sty file in TDS:

env = Environment(tools = ['kpsewhich'])
files = env.KPSFindAllFiles('unicode.sty')

Other functions (correspond directly to kpsewhich function options):

texmf = env.KPSExpandBraces('a{b,c}d')# kpsewhich -expand-braces 'a{b,c}d'
texmf = env.KPSExpandPath('$TEXMF')   # kpsewhich -expand-path '$TEXMF'
texmf = env.KPSExpandVar('$TEXMF')    # kpsewhich -expand-var '$TEXMF'
texpath = env.KPSShowPath('tex')      # kpsewhich -show-path 'tex'
home = env.KPSVarValue('TEXMFHOME')   # kpsewhich -var-value 'TEXMFHOME'

CONSTRUCTION VARIABLES

The following construction variables may be used to configure the kpsewhich tool. They may be also provided as keyword arguments to KPSXxx() methods.

Variable

Description

KPSEWHICH

the kpsewhich executable

KPSEWHICHFLAGS

additional flags to kpsewhich

KPSVARIABLES

(re)define variables for kpsewhich

KPSVARIABLES must be a dictionary in form { NAME : VALUE }, for example:

KPSVARIABLES = {"TEXMFHOME" : "/home/ptomulik/texmf"}

ARGUMENTS

These arguments are accepted by some KPSXxx() methods. All the methods accept progname. All other arguments are accepted by KPSFindFiles and KPSFindAllFiles.

Variable

Description

dpi

corresponds to -dpi flag,

format

corresponds to -format flag,

path

corresponds to -path flag

progname

corresponds to -progname flag

subdir

corresponds to -subdir flag

LICENSE

Copyright (c) 2013-2020 by Paweł Tomulik

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE

Metadata

Release files for scons-tool-kpsewhich 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for scons-tool-kpsewhich 0.2.0
File Size Uploaded Provenance
scons-tool-kpsewhich-0.2.0.tar.gz 7.9 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for scons-tool-kpsewhich 0.2.0
File Interpreter ABI Platform
scons_tool_kpsewhich-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 15.8 kB

Release files / scons-tool-kpsewhich-0.2.0.tar.gz

Download URL scons-tool-kpsewhich-0.2.0.tar.gz
Size 7.9 kB
Tags Source
SHA-256 checksum
How to use checksums
3c818d002816b2ba95fe7863f6995c0dc12047ef9b0928e7397e0b375105b892
BLAKE2b-256 checksum
How to use checksums
f952ff3f0e7bc7e0a04ce95091bfe19f564b099f8010fba1a058e62f05948478
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.2

Release files / scons_tool_kpsewhich-0.2.0-py3-none-any.whl

Download URL scons_tool_kpsewhich-0.2.0-py3-none-any.whl
Size 7.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
49a99057b81c846275a15affcae3619a0e4a1db4d7b038119d7c19584c11ccbe
BLAKE2b-256 checksum
How to use checksums
44d8ef2ee0fce396d7a28f1801e6d01762dcf2e72e1b94663cd8f6c5b0b06b05
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.2

Security for scons-tool-kpsewhich 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page