Skip to content

Commit

Permalink
Merge pull request #30 from xiachufang/l8ng/update
Browse files Browse the repository at this point in the history
feat!: 放弃2.7支持&使用新工具链和配置
  • Loading branch information
StrayDragon authored Apr 23, 2024
2 parents ff47f73 + a6f1eb0 commit ebbf9ad
Show file tree
Hide file tree
Showing 20 changed files with 299 additions and 312 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: CI
on:
pull_request:
branches-ignore:
- "release-**"

jobs:
test:
runs-on: ubuntu-22.04
strategy:
matrix:
python-version:
- "3.7"
- "3.8"
- "3.9"
# - "3.10" # NOTE: 上游库不支持, 需要fork库搞了, 原因是 ImportError: cannot import name 'MutableMapping' from 'collections' (/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/collections/__init__.py)
# - "3.11"
# - "3.12"
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
check-latest: true
- name: Install dependencies
run: |
pip install -e .[test]
- name: Test with pytest
run: |
make test
4 changes: 2 additions & 2 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
name: release please
jobs:
release-please:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- uses: GoogleCloudPlatform/release-please-action@v2
id: release
Expand All @@ -22,7 +22,7 @@ jobs:
if: ${{ steps.release.outputs.release_created }}
uses: actions/setup-python@v2
with:
python-version: 3.6
python-version: 3.7

- name: Publish / Install deps
if: ${{ steps.release.outputs.release_created }}
Expand Down
26 changes: 0 additions & 26 deletions .github/workflows/test.yml

This file was deleted.

5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Custom
.vscode/settings.json
**/.venv*


# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand Down
23 changes: 0 additions & 23 deletions .importanizerc

This file was deleted.

55 changes: 26 additions & 29 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,32 +1,29 @@
# See http://pre-commit.com for more information
# See http://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v1.2.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-docstring-first
- id: check-json
- id: check-added-large-files
- id: check-yaml
- id: debug-statements
language_version: python3.7
- repo: https://github.com/asottile/pyupgrade
rev: v1.1.4
hooks:
- id: pyupgrade
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.610-1
hooks:
- id: mypy
- repo: https://github.com/miki725/importanize/
rev: 'master'
hooks:
- id: importanize
args: [--verbose]
- repo: https://github.com/psf/black
rev: 20.8b1
hooks:
- id: black
language_version: python3
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-docstring-first
- id: check-json
- id: check-added-large-files
- id: check-yaml
- id: debug-statements
- repo: https://github.com/asottile/pyupgrade
rev: v3.15.2
hooks:
- id: pyupgrade
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.9.0
hooks:
- id: mypy
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.4.1
hooks:
# Run the linter.
- id: ruff
# Run the formatter.
- id: ruff-format
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
test:
@pip install pytest gevent
pytest -vv -s tests/
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ print(client.get_group("namespace_1", unit="your_unit"))
# Dev

```shell
# install deps (once)
pip install -e .[test]

# run test
make test

Expand Down
5 changes: 0 additions & 5 deletions mypy.ini

This file was deleted.

3 changes: 1 addition & 2 deletions outplan/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
# coding: utf-8

from .client import ExperimentGroupClient
from .exceptions import ExperimentBaseError
from .experiment import ExperimentItem, GroupItem, NamespaceItem

__version__ = "2.2.0"

__all__ = (
"ExperimentGroupClient",
Expand Down
Loading

0 comments on commit ebbf9ad

Please sign in to comment.