Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bob.devtools
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
bob
bob.devtools
Commits
50cf4202
Commit
50cf4202
authored
5 years ago
by
Zohreh MOSTAANI
Browse files
Options
Downloads
Patches
Plain Diff
added command to generate documentations locally
parent
34e754ce
No related branches found
No related tags found
Loading
Pipeline
#30692
passed
5 years ago
Stage: build
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
bob/devtools/scripts/local.py
+83
-0
83 additions, 0 deletions
bob/devtools/scripts/local.py
setup.py
+5
-0
5 additions, 0 deletions
setup.py
with
88 additions
and
0 deletions
bob/devtools/scripts/local.py
0 → 100644
+
83
−
0
View file @
50cf4202
#!/usr/bin/env python
import
os
import
sys
import
re
import
glob
import
shutil
import
gitlab
import
yaml
import
click
import
pkg_resources
from
click_plugins
import
with_plugins
from
.
import
bdt
from
.
import
ci
from
..constants
import
SERVER
,
CONDA_BUILD_CONFIG
,
CONDA_RECIPE_APPEND
,
\
WEBDAV_PATHS
,
BASE_CONDARC
from
..deploy
import
deploy_conda_package
,
deploy_documentation
from
..ci
import
read_packages
,
comment_cleanup
,
uniq
from
..log
import
verbosity_option
,
get_logger
,
echo_normal
logger
=
get_logger
(
__name__
)
def
set_up_environment_variables
(
python
,
name_space
,
project_dir
=
'
.
'
,
project_visibility
=
'
public
'
):
"""
This function sets up the proper environment variables when user wants to run the commands usually run on ci
locally
"""
os
.
environ
[
'
CI_JOB_TOKEN
'
]
=
gitlab
.
Gitlab
.
from_config
(
'
idiap
'
).
private_token
os
.
environ
[
'
CI_PROJECT_DIR
'
]
=
project_dir
os
.
environ
[
'
CI_PROJECT_NAMESPACE
'
]
=
name_space
os
.
environ
[
'
CI_PROJECT_VISIBILITY
'
]
=
project_visibility
os
.
environ
[
'
PYTHON_VERSION
'
]
=
python
@with_plugins
(
pkg_resources
.
iter_entry_points
(
'
bdt.local.cli
'
))
@click.group
(
cls
=
bdt
.
AliasedGroup
)
def
local
():
"""
Commands for building packages and handling certain activities locally
it requires a proper set up for ~/.python-gitlab.cfg
Commands defined here can be run in your own installation.
"""
pass
@local.command
(
epilog
=
'''
Examples:
1. Prepares the docs locally:
$ bdt local docs -vv requirements.txt
'''
)
@click.argument
(
'
requirement
'
,
required
=
True
,
type
=
click
.
Path
(
file_okay
=
True
,
dir_okay
=
False
,
exists
=
True
),
nargs
=
1
)
@click.option
(
'
-d
'
,
'
--dry-run/--no-dry-run
'
,
default
=
False
,
help
=
'
Only goes through the actions, but does not execute them
'
\
'
(combine with the verbosity flags - e.g. ``-vvv``) to enable
'
\
'
printing to help you understand what will be done
'
)
@click.option
(
'
-p
'
,
'
--python
'
,
default
=
(
'
%d.%d
'
%
sys
.
version_info
[:
2
]),
show_default
=
True
,
help
=
'
Version of python to build the environment for
'
)
@click.option
(
'
-g
'
,
'
--group
'
,
show_default
=
True
,
default
=
'
bob
'
,
help
=
'
Group of packages (gitlab namespace) this package belongs to
'
)
@verbosity_option
()
@bdt.raise_on_error
@click.pass_context
def
docs
(
ctx
,
requirement
,
dry_run
,
python
,
group
):
"""
Prepares documentation build
This command:
1. Clones all the necessary packages necessary to build the bob/beat
documentation
2. Generates the `extra-intersphinx.txt` and `nitpick-exceptions.txt` file
"""
set_up_environment_variables
(
python
=
python
,
name_space
=
group
)
ctx
.
invoke
(
ci
.
docs
,
requirement
=
requirement
,
dry_run
=
dry_run
)
\ No newline at end of file
This diff is collapsed.
Click to expand it.
setup.py
+
5
−
0
View file @
50cf4202
...
@@ -55,6 +55,7 @@ setup(
...
@@ -55,6 +55,7 @@ setup(
'
test = bob.devtools.scripts.test:test
'
,
'
test = bob.devtools.scripts.test:test
'
,
'
caupdate = bob.devtools.scripts.caupdate:caupdate
'
,
'
caupdate = bob.devtools.scripts.caupdate:caupdate
'
,
'
ci = bob.devtools.scripts.ci:ci
'
,
'
ci = bob.devtools.scripts.ci:ci
'
,
'
local = bob.devtools.scripts.local:local
'
,
'
gitlab = bob.devtools.scripts.gitlab:gitlab
'
,
'
gitlab = bob.devtools.scripts.gitlab:gitlab
'
,
],
],
...
@@ -82,6 +83,10 @@ setup(
...
@@ -82,6 +83,10 @@ setup(
'
docs = bob.devtools.scripts.ci:docs
'
,
'
docs = bob.devtools.scripts.ci:docs
'
,
],
],
'
bdt.local.cli
'
:
[
'
docs = bob.devtools.scripts.local:docs
'
,
],
},
},
classifiers
=
[
classifiers
=
[
'
Framework :: Bob
'
,
'
Framework :: Bob
'
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment