Commit 46384fc9 authored by Wei Shoulin's avatar Wei Shoulin
Browse files

Initial commit

parents
Loading
Loading
Loading
Loading

.coveragerc

0 → 100644
+6 −0
Original line number Diff line number Diff line
[run]
omit =
    tests/*
    setup.py
    test_codestyle.py
    csst_dfs_client/version.py

.gitignore

0 → 100644
+128 −0
Original line number Diff line number Diff line
.vscode
.idea
*.DS_Store*
*.pyc
*~
**/dist
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
#  Usually these files are written by a python script from a template
#  before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit examples / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
.python-version

# pipenv
#   According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
#   However, in case of collaboration, if having platform-specific dependencies or dependencies
#   having no cross-platform support, pipenv may install dependencies that don't work, or not
#   install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/


# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# Pyre type checker
.pyre/

# joblib temp
joblib*
 No newline at end of file

.gitlab-ci.yml

0 → 100644
+59 −0
Original line number Diff line number Diff line
stages:
  - build
  - code_check
  - test
  - deploy

build-job:
  stage: build
  image: python:3.11
  variables:
    GIT_CLONE_PATH: $CI_BUILDS_DIR/work
  before_script:
    - ls
  after_script:
    - ls
  script:
    - whoami
    - echo $SHELL
    - pwd
    - make wheel
  artifacts:
    paths:
      - dist/*.whl
  only:
    - main
  tags:
    - asos2-unit-test

test-job:
  stage: test
  image: python:3.11
  variables:
    GIT_CLONE_PATH: $CI_BUILDS_DIR/work
  script:
    - pip install -r requirements-test.txt -i https://mirrors.aliyun.com/pypi/simple
    - pip install .
    - make test
  coverage: '/TOTAL.*\s+(\d+\%)/'
  only:
    - main
  tags:
    - asos2-unit-test

deploy-job:
  stage: deploy
  image: python:3.11
  variables:
    GIT_CLONE_PATH: $CI_BUILDS_DIR/work
  script:
    - pip install -r requirements-deploy.txt --trusted-host mirror.int.cnlab.net -i http://mirror.int.cnlab.net/repository/py/simple
    - make wheel
    - make publish
  artifacts:
    paths:
      - dist/*.whl    
  only:
    - main
  tags:
    - asos2-unit-test    
 No newline at end of file

LICENSE

0 → 100644
+674 −0

File added.

Preview size limit exceeded, changes collapsed.

Makefile

0 → 100644
+27 −0
Original line number Diff line number Diff line
all: clean install clean

clean:
	rm -rf build dist csst_dfs_client.egg-info
	rm -rf .coverage .pytest_cache

install: clean
	pip install .
	rm -rf build dist csst_dfs_client.egg-info

uninstall:
	pip uninstall csst_dfs_client -y

test:
	UNIT_TEST_DATA_ROOT=/opt/temp/csst CSST_DFS_GATEWAY=http://172.31.249.145:8000 CSST_DFS_TOKEN=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjQ4ODU0NTA2NjQsInN1YiI6InN5c3RlbSJ9.POsuUABytu8-WMtZiYehiYEa5BnlgqNTXT6X3OTyix0 coverage run -m pytest -vs --import-mode=importlib --cov-report=html --cov-report=term-missing --cov-config=.coveragerc
	coverage report -m
	rm -rf .coverage .pytest_cache
	
build:
	rm -rf dist/*.whl
	python setup.py bdist_wheel --plat-name=manylinux1_x86_64

publish:
	twine upload --repository-url http://mirror.int.cnlab.net/repository/pypi/ -u admin -p gsdjsj.2024 dist/csst_dfs_client-*.whl

version:
	bumpver update --patch 
Loading