Skip to content

Commit

Permalink
Remove setup.py and add pyproject.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
sbsekiguchi committed Aug 2, 2024
1 parent 58adf0d commit 1aa7139
Show file tree
Hide file tree
Showing 8 changed files with 152 additions and 118 deletions.
10 changes: 5 additions & 5 deletions setup.py → .flake8
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Copyright 2020,2021 Sony Corporation.
# Copyright 2021 Sony Group Corporation.
# Copyright 2024 Sony Group Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -13,6 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from setuptools import setup

setup()
[flake8]
max-line-length = 120
extend-ignore = E203,E701
filename = "*.py"
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -177,4 +177,4 @@ jobs:
pip install -r requirements.txt
- name: check pydoc format with docformat
run: |
docformatter --exclude build --check --config setup.cfg .
docformatter --exclude build --check --config pyproject.toml .
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
pip install -r deploy_requirements.txt
- name: Build release distributions
run: |
python setup.py bdist_wheel
python -m build --wheel
- name: Temporarily upload release distribution
uses: actions/upload-artifact@v3
with:
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ You can run tests with the following command.

```sh
cd <nnabla-rl root directory>
python setup.py test
pytest
```

#### Evaluating the algorithm
Expand Down Expand Up @@ -145,5 +145,5 @@ Use docformatter to properly format the pydoc written in each python files.
Run docformatter as follows:

```sh
docformatter --exclude build --i --config setup.cfg .
docformatter --exclude build --i --config pyproject.toml .
```
4 changes: 2 additions & 2 deletions bin/insert_copyright
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env python3
# Copyright 2021,2022 Sony Group Corporation.
# Copyright 2021,2022,2023,2024 Sony Group Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -20,7 +20,7 @@ import re
import subprocess

_exclude_dirs = ['external', '.git']
_insert_file_regex = re.compile('.*.(py|cfg|ini|sh)')
_insert_file_regex = re.compile('.*.(py|cfg|ini|sh|toml|flake8)')
_header_extract_regex = re.compile('# Copyright \\d{4}.*? limitations under the License.', re.DOTALL)
_shebang_extract_regex = re.compile('#!.+')
_date_extract_regex = re.compile('(\\d{4}-\\d{2}-\\d{2})')
Expand Down
3 changes: 2 additions & 1 deletion deploy_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
setuptools
setuptools >= 61.0.0
wheel
numpy>=1.17
build
139 changes: 139 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
# Copyright 2024 Sony Group Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

[build-system]
requires = [
"setuptools >= 61.0.0",
"wheel",
"pytest-runner"
]
build-backend = "setuptools.build_meta"

[project]
name = "nnabla_rl"
authors = [
{ name = "Sony Group Corporation" }
]
maintainers = [
{ name = "Yu Ishihara" },
{ name = "Shunichi Sekiguchi" },
{ name = "Takayoshi Takayanagi" },
]
description = "Deep reinforcement learning library built on top of Neural Network Libraries"
license = {file = "LICENSE"}
readme = "README.md"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Intended Audience :: Education",
"Intended Audience :: Science/Research",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Operating System :: POSIX :: Linux"
]
keywords = [
"deep learning",
"artificial intelligence",
"machine learning",
"neural network"
]
requires-python = ">=3.8"
dynamic = ["version"]
dependencies = [
"nnabla >= 1.17, != 1.18.0",
"numpy >= 1.17",
"gym < 0.26.0",
"opencv-python",
"packaging",
"tqdm",
"gymnasium"
]

[project.urls]
Homepage = "https://github.com/sony/nnabla-rl"
Repository = "https://github.com/sony/nnabla-rl"
Documentation = "https://nnabla-rl.readthedocs.io/en/latest/"

[project.optional-dependencies]
render = ["pyglet >= 1.4.0"]
dev = [
"flake8",
"pylint",
"pytest",
"pytest-cov",
"mypy != 1.11.0",
"typing-extensions",
"isort",
"autopep8",
"docformatter"
]
deploy = [
"setuptools >= 61.0.0",
"wheel",
"build",
"twine"
]
doc = ["sphinx", "sphinx_rtd_theme"]
test = [
"pytest",
"pytest-cov",
"mock"
]

[tool.setuptools.dynamic]
version = {attr = "nnabla_rl.__version__"}

[tool.setuptools.packages.find]
exclude = [
"bin*",
"docs*",
"examples*",
"interactive-demos",
"reproductions*",
"tests*",
"test_resources*",
]

[tool.pytest.ini_options]
testpaths = ["tests"]
addopts = "-s"

[tool.autopep8]
max_line_length = 120
recursive = true

[tool.isort]
line_length = 120
honor_noqa = true
known_first_party = ["nnabla"]
skip_glob = ["external"]

[tool.mypy]
python_version = 3.8
ignore_missing_imports = true
no_implicit_optional = true
warn_unused_configs = true
warn_redundant_casts = true
warn_unused_ignores = true
warn_return_any = true
warn_unreachable = true
files = ["nnabla_rl"]

[tool.docformatter]
recursive = true
106 changes: 0 additions & 106 deletions setup.cfg

This file was deleted.

0 comments on commit 1aa7139

Please sign in to comment.