Setup as 'pip' library
All checks were successful
ydeng/mltraining/pipeline/head This commit looks good
All checks were successful
ydeng/mltraining/pipeline/head This commit looks good
This commit is contained in:
parent
80a62a6e32
commit
4c0e7fe25c
35
Jenkinsfile
vendored
Normal file
35
Jenkinsfile
vendored
Normal file
@ -0,0 +1,35 @@
|
||||
pipeline {
|
||||
agent any
|
||||
stages {
|
||||
stage("install") {
|
||||
steps {
|
||||
sh 'mamba env update --file environment.yml --prefix ./env || mamba env create --force --file environment.yml --prefix ./env'
|
||||
sh 'echo conda environment: $CONDA_PREFIX'
|
||||
}
|
||||
}
|
||||
stage("unit tests") {
|
||||
steps {
|
||||
sh returnStatus: true, script: "python -m pytest --junitxml=test_results.tests.xml --cov-report xml:test_coverage.coverage.xml --cov=mltraining"
|
||||
xunit checksName: '', thresholdMode: 2, thresholds: [failed(unstableThreshold: '90')], tools: [JUnit(excludesPattern: '', pattern: 'test_results.tests.xml', stopProcessingIfError: true)]
|
||||
// cobertura autoUpdateHealth: false, autoUpdateStability: false, coberturaReportFile: 'test_coverage.coverage.xml', failUnhealthy: false, failUnstable: false, maxNumberOfBuilds: 64, lineCoverageTargets: '50, 0, 0', methodCoverageTargets: '50, 0, 0', onlyStable: false, sourceEncoding: 'ASCII', zoomCoverageChart: false
|
||||
}
|
||||
}
|
||||
stage("build") {
|
||||
steps {
|
||||
sh 'rm -rf ./dist/*'
|
||||
sh "python -m build"
|
||||
}
|
||||
}
|
||||
stage("publish") {
|
||||
environment {
|
||||
CREDS = credentials('rs-git-package-registry-ydeng')
|
||||
}
|
||||
when {
|
||||
branch '**/main'
|
||||
}
|
||||
steps {
|
||||
sh returnStatus: true, script: 'python -m twine upload --repository-url https://git.reslate.systems/api/packages/${CREDS_USR}/pypi -u ${CREDS_USR} -p ${CREDS_PSW} --non-interactive --disable-progress-bar --verbose dist/*'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,8 +1,14 @@
|
||||
name: huggingface_transformers_utils
|
||||
name: mltraining
|
||||
channels:
|
||||
- conda-forge
|
||||
- huggingface
|
||||
dependencies:
|
||||
- transformers=4.28
|
||||
- python-build=0.10
|
||||
- pip=23.1
|
||||
- setuptools=67.7
|
||||
- pytest=7.3
|
||||
- pytest-cov=4
|
||||
- pip:
|
||||
- evaluate==0.4.0
|
||||
- evaluate==0.4
|
||||
- datasets==2.12
|
||||
|
18
setup.cfg
Normal file
18
setup.cfg
Normal file
@ -0,0 +1,18 @@
|
||||
[metadata]
|
||||
name = mltraining
|
||||
version = 0.0.1
|
||||
|
||||
[options]
|
||||
package_dir =
|
||||
= src
|
||||
packages = mltraining
|
||||
install_requires =
|
||||
transformers==4.28
|
||||
evaluate==0.4
|
||||
datasets==2.12
|
||||
pytest==7.3
|
||||
|
||||
[tool:pytest]
|
||||
pythonpath = src
|
||||
testpaths = tests
|
||||
log_cli = 1
|
5
tests/test_trainers.py
Normal file
5
tests/test_trainers.py
Normal file
@ -0,0 +1,5 @@
|
||||
import pytest
|
||||
|
||||
def test_placeholder():
|
||||
# TODO Placeholder test for library
|
||||
assert True
|
Reference in New Issue
Block a user