Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Pypelines
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
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
HaissLab
Data Management
Pypelines
Commits
466aa690
Commit
466aa690
authored
10 months ago
by
Timothe Jost
Browse files
Options
Downloads
Patches
Plain Diff
PypelineLoggerProtocol typehint on getLogger
parent
c6895835
No related branches found
No related tags found
No related merge requests found
Pipeline
#131771
passed
10 months ago
Stage: test
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/pypelines/__init__.py
+1
-1
1 addition, 1 deletion
src/pypelines/__init__.py
src/pypelines/loggs.py
+18
-0
18 additions, 0 deletions
src/pypelines/loggs.py
src/pypelines/pipelines.py
+1
-6
1 addition, 6 deletions
src/pypelines/pipelines.py
with
20 additions
and
7 deletions
src/pypelines/__init__.py
+
1
−
1
View file @
466aa690
__version__
=
"
0.0.6
1
"
__version__
=
"
0.0.6
2
"
from
.
import
loggs
from
.pipes
import
*
...
...
This diff is collapsed.
Click to expand it.
src/pypelines/loggs.py
+
18
−
0
View file @
466aa690
...
...
@@ -13,10 +13,28 @@ from coloredlogs import (
)
from
pathlib
import
Path
from
typing
import
Protocol
,
Callable
,
cast
NAMELENGTH
=
33
# global variable for formatting the length of the padding dedicated to name part in a logging record
LEVELLENGTH
=
9
# global variable for formatting the length of the padding dedicated to levelname part in a record
class
PypelineLoggerProtocol
(
Protocol
):
def
save
(
self
,
msg
,
*
args
,
**
kwargs
)
->
None
:
...
def
load
(
self
,
msg
,
*
args
,
**
kwargs
)
->
None
:
...
def
note
(
self
,
msg
,
*
args
,
**
kwargs
)
->
None
:
...
def
start
(
self
,
msg
,
*
args
,
**
kwargs
)
->
None
:
...
def
end
(
self
,
msg
,
*
args
,
**
kwargs
)
->
None
:
...
def
header
(
self
,
msg
,
*
args
,
**
kwargs
)
->
None
:
...
class
PypelineLogger
(
logging
.
Logger
,
PypelineLoggerProtocol
):
pass
getLogger
=
cast
(
Callable
[[
str
],
PypelineLogger
],
logging
.
getLogger
)
def
enable_logging
(
filename
:
str
|
None
=
None
,
terminal_level
:
str
=
"
NOTE
"
,
...
...
This diff is collapsed.
Click to expand it.
src/pypelines/pipelines.py
+
1
−
6
View file @
466aa690
...
...
@@ -10,12 +10,7 @@ if TYPE_CHECKING:
from
.graphs
import
PipelineGraph
class
PipelineType
(
Protocol
):
def
__getattr__
(
self
,
name
:
str
)
->
"
BasePipe
"
:
...
class
Pipeline
(
PipelineType
):
class
Pipeline
:
pipes
:
Dict
[
str
,
"
BasePipe
"
]
runner_backend_class
=
BaseTaskBackend
...
...
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