Skip to content

Commit

Permalink
[arch] initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
tswsxk committed Mar 18, 2021
1 parent b1887e1 commit 32c7aed
Show file tree
Hide file tree
Showing 11 changed files with 404 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: 'Bug, needs triage'

---
## 🐛 Description
(A clear and concise description of what the bug is.)

### Error Message
(Paste the complete error message. Please also include stack trace by setting environment variable `DMLC_LOG_STACK_TRACE_DEPTH=100` before running your script.)

## To Reproduce
(If you developed your own code, please provide a short script that reproduces the error. For existing examples, please provide link.)

### Steps to reproduce
(Paste the commands you ran that produced the error.)

1.
2.

## What have you tried to solve it?

1.
2.

## Environment

<details>
<summary>Environment Information</summary>

**Operating System:** ...

**Python Version:** (e.g., python3.6, anaconda/python3.7, venv/python3.8)

</details>

## Additional context
6 changes: 6 additions & 0 deletions .github/ISSUE_TEMPLATE/documentation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
name: 📚 Documentation
about: Update api documentation or add the data analysis
---

## 📚 Documentation
17 changes: 17 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: 'Feature request'

---

## Description
(A clear and concise description of what the feature is.)
- If the proposal is about a new dataset, provide description of what the dataset is and
attach the basic data analysis with it.
- If the proposal is about an API, provide mock examples if possible.

## References
- list reference and related literature
- list known implementations
51 changes: 51 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
Thanks for sending a pull request!
Please make sure you click the link above to view the [contribution guidelines](../blob/master/CONTRIBUTE.md),
then fill out the blanks below.

## Description ##
(Brief description on what this PR is about)

### What does this implement/fix? Explain your changes.
...

#### Pull request type
- [ ] [DATASET] Add a new dataset
- [ ] [BUGFIX] Bugfix
- [ ] [FEATURE] New feature (non-breaking change which adds functionality)
- [ ] [BREAKING] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] [STYLE] Code style update (formatting, renaming)
- [ ] [REFACTOR] Refactoring (no functional changes, no api changes)
- [ ] [BUILD] Build related changes
- [ ] [DOC] Documentation content changes
- [ ] [Sync] Synchronization with a repository
- [ ] [OTHER] Other (please describe):


#### Changes
- Feature1, tests, (and when applicable, API doc)
- Feature2, tests, (and when applicable, API doc)

or

- Fix1, tests
- Fix2, tests

### Does this close any currently open issues?
...

### Any relevant logs, error output, etc?
...

## Checklist ##
Before you submit a pull request, please make sure you have to following:

### Essentials ###
- [ ] PR's title starts with a category (e.g. [BUGFIX], [FEATURE], [BREAKING], [DOC], etc)
- [ ] Changes are complete (i.e. I finished coding on this PR)
- [ ] All changes have test coverage and al tests passing
- [ ] Code is well-documented (extended the README / documentation, if necessary)
- [ ] If this PR is your first one, add your name and github account to [AUTHORS.md](https://github.com/bigdata-ustc/EduData/blob/master/AUTHORS.md)

## Comments ##
- If this change is a backward incompatible change, why must this change be made.
- Interesting edge cases to note here
31 changes: 31 additions & 0 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# This workflows will upload a Python Package using Twine when a release is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries

name: Upload Python Package

on:
release:
types: [created]

jobs:
deploy:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
112 changes: 112 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib64/
parts/
sdist/
var/
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 test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

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

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/
**/_build/
**/_build/*

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# SageMath parsed files
*.sage.py

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

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# IDE
.idea/
.vscode/
.DS_Store

# Pyre type checker
.pyre/

# User Definition
18 changes: 18 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
language: python

matrix:
include:
- python: 3.6
- python: 3.7
- python: 3.8
- python: 3.9
dist: xenial
sudo: true

install:
- pip install -e .[test]
- pip install codecov

script:
- pytest
- codecov
83 changes: 83 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
VERSION=`ls dist/*.tar.gz | sed "s/dist\/EduKTM-\(.*\)\.tar\.gz/\1/g"`

ifdef ENVPIP
PIP = $(ENVPIP)
else
PIP = pip3
endif

ifdef ENVPYTHON
PYTHON = $(ENVPYTHON)
else
PYTHON = python3
endif

ifdef ENVPYTEST
PYTEST = $(ENVPYTEST)
else
PYTEST = pytest
endif

help:

@echo "install install EduKTM"
@echo "test run test"
@echo "release publish to PyPI and release in github"
@echo "release_test publish to TestPyPI"
@echo "clean remove all build, test, coverage and Python artifacts"
@echo "clean-build remove build artifacts"
@echo "clean-pyc remove Python file artifacts"
@echo "clean-test remove test and coverage artifacts"

.PHONY: install, test, build, release, release_test, version, .test, .build, clean

install:
@echo "install EduKTM"
$(PIP) install -e . --user

test:
@echo "run test"
$(PYTEST)

build: test, clean
$(PYTHON) setup.py bdist_wheel sdist

.test:
$(PYTEST) > /dev/null

.build: clean
$(PYTHON) setup.py bdist_wheel sdist > /dev/null

version: .build
@echo $(VERSION)

release: test, build
@echo "publish to pypi and release in github"
@echo "version $(VERSION)"

-@twine upload dist/* && git tag "v$(VERSION)"
git push && git push --tags

release_test: test, build
@echo "publish to test pypi"
@echo "version $(VERSION)"

-@twine upload --repository test dist/*

clean: clean-build clean-pyc clean-test

clean-build:
rm -rf build/*
rm -rf dist/*
rm -rf .eggs/*
find . -name '*.egg-info' -exec rm -fr {} +
find . -name '*.egg' -exec rm -f {} +

clean-pyc:
find . -name '*.pyc' -exec rm -f {} +
find . -name '*.pyo' -exec rm -f {} +
find . -name '*~' -exec rm -f {} +
find . -name '__pycache__' -exec rm -rf {} +

clean-test:
rm -f .coverage
17 changes: 17 additions & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[pytest]
# For pytest usage, refer to https://hb4dsai.readthedocs.io/zh/latest/Architecture/Test.html
norecursedirs = docs *build* trash dev

# Deal with marker warnings
markers =
flake8: flake8

# Enable line length testing with maximum line length of 120
flake8-max-line-length = 120

# Ignore module level import not at top of file (E402)
# Others can be found in https://flake8.pycqa.org/en/latest/user/error-codes.html
flake8-ignore = E402 F401 F403

# --doctest-modules is used for unitest
addopts = --doctest-modules --cov --cov-report=term-missing --flake8
11 changes: 11 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[coverage:run]
source=EduKTM
[coverage:report]
exclude_lines =
pragma: no cover
pass
raise NotImplementedError
if __name__ == '__main__':
if __name__ == "__main__":
def __str__
def __repr__
Loading

0 comments on commit 32c7aed

Please sign in to comment.