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

support Python 3.12 #325

Merged
merged 9 commits into from
Jan 16, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.9
python-version: 3.11
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pyproject-flake8 doen't support python3.12. So, I use Python3.11 for format CI.

csachs/pyproject-flake8#30

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I Think It's OK because it's just for formatting

- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
max-parallel: 4
matrix:
platform: [ubuntu-latest]
python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: ["3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion gokart/pandas_type_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,5 @@ def __init__(self, *args, **kwargs) -> None:
}

def check(self, obj, task_namespace: str):
if type(obj) == pd.DataFrame and task_namespace in self._map:
if isinstance(obj, pd.DataFrame) and task_namespace in self._map:
self._map[task_namespace].check(obj)
4 changes: 2 additions & 2 deletions gokart/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ def get_info(self, only_significant=False):
params = dict(self.get_params())
for param_name, param_value in self.param_kwargs.items():
if (not only_significant) or params[param_name].significant:
if type(params[param_name]) == gokart.TaskInstanceParameter:
if isinstance(params[param_name], gokart.TaskInstanceParameter):
params_str[param_name] = type(param_value).__name__ + '-' + param_value.make_unique_id()
else:
params_str[param_name] = params[param_name].serialize(param_value)
Expand Down Expand Up @@ -452,7 +452,7 @@ def _get_module_versions(self) -> str:
for x in set([x.split('.')[0] for x in globals().keys() if isinstance(x, types.ModuleType) and '_' not in x]):
module = import_module(x)
if '__version__' in dir(module):
if type(module.__version__) == str:
if isinstance(module.__version__, str):
version = module.__version__.split(" ")[0]
else:
version = '.'.join([str(v) for v in module.__version__])
Expand Down
2 changes: 1 addition & 1 deletion gokart/tree/task_info_formatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def make_task_info_tree(task: TaskOnKart, ignore_task_names: Optional[List[str]]

params = task.get_info(only_significant=True)
processing_time = task.get_processing_time()
if type(processing_time) == float:
if isinstance(processing_time, float):
processing_time = str(processing_time) + 's'
is_complete = ('COMPLETE' if is_task_complete else 'PENDING')
task_log = dict(task.get_task_log())
Expand Down
2,205 changes: 1,120 additions & 1,085 deletions poetry.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ style = "pep440"
pattern = "^(?P<base>\\d+\\.\\d+\\.\\d+)"

[tool.poetry.dependencies]
python = ">=3.8,<3.12"
python = ">=3.9,<3.13"
luigi = "*"
boto3 = "*"
slack-sdk = "^3"
Expand All @@ -32,7 +32,7 @@ redis = "*"
matplotlib = "*"

[tool.poetry.group.dev.dependencies]
pyproject-flake8 = "5.0.4"
pyproject-flake8 = "^6.1.0"
tox = "*"
moto = "*"
testfixtures = "*"
Expand Down
4 changes: 2 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py{38,39,310,311},yapf,isort,flake8,mypy
envlist = py{39,310,311,312},yapf,isort,flake8,mypy
isolated_build = true

[testenv]
Expand Down Expand Up @@ -29,7 +29,7 @@ commands = mypy gokart test {posargs}

[gh-actions]
python =
3.8: py38
3.9: py39
3.10: py310
3.11: py311
3.12: py312