forked from theacodes/cmarkgfm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
noxfile.py
46 lines (38 loc) · 1.42 KB
/
noxfile.py
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
43
44
45
46
import os
import platform
import shutil
import nox
@nox.session(py=['2.7', '2.7-32', '3.5', '3.6', '3.7', '3.8', '3.9'])
def unit(session):
session.install('pytest', 'pytest-cov')
session.install('.')
session.run(
'pytest',
'--cov-report', '',
'--cov', 'cmarkgfm',
'--cov', 'tests',
'tests', *session.posargs)
session.run('coverage', 'report', '--show-missing')
@nox.session
def lint(session):
session.install('flake8')
session.run('flake8', 'src/cmarkgfm', 'tests')
session.install('readme_renderer')
session.run('python', 'setup.py', 'check', '-m', '-r', '-s')
@nox.session(py=False)
def regenerate(session):
"""Regenerates header files for cmark under ./generated."""
if platform.system() == 'Windows':
output_dir = '../generated/windows'
else:
output_dir = '../generated/unix'
session.run(shutil.rmtree, 'build', ignore_errors=True)
session.run(os.makedirs, 'build')
session.chdir('build')
session.run('cmake', '../third_party/cmark')
session.run(shutil.copy, 'src/cmark-gfm_export.h', output_dir)
session.run(shutil.copy, 'src/cmark-gfm_version.h', output_dir)
session.run(shutil.copy, 'src/config.h', output_dir)
session.run(shutil.copy, 'extensions/cmark-gfm-extensions_export.h', output_dir)
session.chdir('..')
session.run(shutil.rmtree, 'build')