Including example Travis CI configuration from examples/ directory in docs/setup.md
This commit is contained in:
@@ -9,6 +9,8 @@ TAG_REGEX_PATTERN = re.compile(
|
|||||||
"(?P<filename>[^"]+)" # "filename"
|
"(?P<filename>[^"]+)" # "filename"
|
||||||
(?:\s+start="(?P<start>[^"]+)")? # optional start expression
|
(?:\s+start="(?P<start>[^"]+)")? # optional start expression
|
||||||
(?:\s+end="(?P<end>[^"]+)")? # optional end expression
|
(?:\s+end="(?P<end>[^"]+)")? # optional end expression
|
||||||
|
(?:\s+before="(?P<before>[^"]+)")? # optional preceding text to add
|
||||||
|
(?:\s+after="(?P<after>[^"]+)")? # optional succeeding text to add
|
||||||
\s*
|
\s*
|
||||||
%} # closing tag
|
%} # closing tag
|
||||||
''',
|
''',
|
||||||
@@ -23,6 +25,8 @@ class ImportMarkdownPlugin(mkdocs.plugins.BasePlugin):
|
|||||||
filename = match.group('filename')
|
filename = match.group('filename')
|
||||||
start = match.group('start')
|
start = match.group('start')
|
||||||
end = match.group('end')
|
end = match.group('end')
|
||||||
|
before = match.group('before')
|
||||||
|
after = match.group('after')
|
||||||
|
|
||||||
file_path_abs = os.path.join(os.path.dirname(page_src_path), filename)
|
file_path_abs = os.path.join(os.path.dirname(page_src_path), filename)
|
||||||
|
|
||||||
@@ -38,12 +42,18 @@ class ImportMarkdownPlugin(mkdocs.plugins.BasePlugin):
|
|||||||
if end:
|
if end:
|
||||||
text_to_include, _, _ = text_to_include.partition(end)
|
text_to_include, _, _ = text_to_include.partition(end)
|
||||||
|
|
||||||
|
if before:
|
||||||
|
text_to_include = before.replace('\\n', '\n') + text_to_include
|
||||||
|
|
||||||
|
if after:
|
||||||
|
text_to_include = text_to_include + after.replace('\\n', '\n')
|
||||||
|
|
||||||
return (
|
return (
|
||||||
'<!-- BEGIN INCLUDE %s %s %s -->' % (
|
'<!-- BEGIN INCLUDE %s %s %s -->\n' % (
|
||||||
filename, cgi.escape(start), cgi.escape(end)
|
filename, cgi.escape(start or ''), cgi.escape(end or '')
|
||||||
)
|
)
|
||||||
+ text_to_include
|
+ text_to_include
|
||||||
+ '<!-- END INCLUDE -->'
|
+ '\n<!-- END INCLUDE -->'
|
||||||
)
|
)
|
||||||
|
|
||||||
markdown = re.sub(TAG_REGEX_PATTERN, found_import_markdown_tag, markdown)
|
markdown = re.sub(TAG_REGEX_PATTERN, found_import_markdown_tag, markdown)
|
||||||
|
|||||||
+5
-29
@@ -52,35 +52,11 @@ Wheels will be stored for you and available through the Pipelines interface. For
|
|||||||
To build Linux, Mac, and Windows wheels on Travis CI, create a `.travis.yml` file in your repo.
|
To build Linux, Mac, and Windows wheels on Travis CI, create a `.travis.yml` file in your repo.
|
||||||
|
|
||||||
> .travis.yml
|
> .travis.yml
|
||||||
```yaml
|
{%
|
||||||
language: python
|
includemarkdown "../examples/travis-ci-deploy-only.yml"
|
||||||
|
before="```yaml\n"
|
||||||
jobs:
|
after="```\n"
|
||||||
include:
|
%}
|
||||||
# perform a linux build
|
|
||||||
- services: docker
|
|
||||||
# and a mac build
|
|
||||||
- os: osx
|
|
||||||
language: shell
|
|
||||||
# and a windows build
|
|
||||||
- os: windows
|
|
||||||
language: shell
|
|
||||||
before_install:
|
|
||||||
- choco install python --version 3.8.0
|
|
||||||
- export PATH="/c/Python38:/c/Python38/Scripts:$PATH"
|
|
||||||
|
|
||||||
env:
|
|
||||||
global:
|
|
||||||
- TWINE_USERNAME=joerick
|
|
||||||
# Note: TWINE_PASSWORD is set in Travis settings
|
|
||||||
|
|
||||||
install:
|
|
||||||
- python -m pip install twine cibuildwheel==1.1.0
|
|
||||||
|
|
||||||
script:
|
|
||||||
# build the wheels, put them into './wheelhouse'
|
|
||||||
- python -m cibuildwheel --output-dir wheelhouse
|
|
||||||
```
|
|
||||||
|
|
||||||
Note that building Windows Python 2.7 wheels on Travis is unsupported.
|
Note that building Windows Python 2.7 wheels on Travis is unsupported.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user