Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
cf = args.ini_file
if (
args.subcmd not in {'init'}
and cf == pathlib.Path('pyproject.toml')
and not cf.is_file()
):
# Fallback to flit.ini if it's present
cf_ini = pathlib.Path('flit.ini')
if cf_ini.is_file():
args.ini_file = cf_ini
else:
sys.exit('Neither pyproject.toml nor flit.ini found, '
'and no other config file path specified')
enable_colourful_output(logging.DEBUG if args.debug else logging.INFO)
log.debug("Parsed arguments %r", args)
if args.logo:
from .logo import clogo
print(clogo.format(version=__version__))
sys.exit(0)
if args.subcmd == 'build':
from .build import main
try:
main(args.ini_file, formats=set(args.format or []),
gen_setup_py=args.setup_py)
except(common.NoDocstringError, common.VCSError, common.NoVersionError) as e:
sys.exit(e.args[0])
elif args.subcmd == 'publish':
def install_plotchecker(symlink):
from pathlib import Path
from flit.install import Installer
from flit.log import enable_colourful_output
import mock
# Hack to make docs build on RTD
MOCK_MODULES = ['numpy', 'matplotlib', 'matplotlib.pyplot', 'matplotlib.colors', 'matplotlib.markers']
for mod_name in MOCK_MODULES:
sys.modules[mod_name] = mock.Mock()
enable_colourful_output()
p = Path('flit.ini')
Installer(p, symlink=symlink, deps='none').install()