Repository: QuantestPy/quantestpy (language: python)

Issue:
Add pyproject.toml for settings
This PR adds pyproject.toml for storing settings.
pyproject.toml contains:
- flake8 config
- `requirements.txt` dependencies information
- `setup.py`

self-introduction: I'm maintaining Qulacs at Osaka University. QuantestPy seems like a good realistic idea (and I want to contribute to this project!)


Discussion / hints:

Fix patch:
diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml
index 54c9556..aa4dbe4 100644
--- a/.github/workflows/github-actions.yml
+++ b/.github/workflows/github-actions.yml
@@ -15,18 +15,15 @@ jobs:
         with:
           python-version: "3.8"
           cache: "pip"
-          cache-dependency-path: "./test/requirements.txt"
+          cache-dependency-path: "pyproject.toml"
 
       - name: Install library
         run: |
-          pip install -r ./test/requirements.txt
+          pip install .[ci]
 
       - name: Run flake8
         run: |
-          python3 -m flake8 --exclude ./quantestpy/__init__.py ./quantestpy/*.py
-          python3 -m flake8 --exclude ./test/__init__.py ./test/*.py
-          python3 -m flake8 --exclude ./test/__init__.py ./test/with_qiskit/*.py
-          python3 -m flake8 ./*.py
+          python3 -m flake8
 
       - name: Run isort
         run: |
@@ -48,11 +45,11 @@ jobs:
         with:
           python-version: "3.8"
           cache: "pip"
-          cache-dependency-path: "./test/with_qiskit/requirements.txt"
+          cache-dependency-path: "pyproject.toml"
 
       - name: Install library
         run: |
-          pip install -r ./test/with_qiskit/requirements.txt
+          pip install .[qiskit]
 
       - name: Run unit test
         run: |
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..0ae652d
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,162 @@
+
+
+# Byte-compiled / optimized / DLL files
+__pycache__/
+*.py[cod]
+*$py.class
+
+# C extensions
+*.so
+
+# Distribution / packaging
+.Python
+build/
+develop-eggs/
+dist/
+downloads/
+eggs/
+.eggs/
+lib/
+lib64/
+parts/
+sdist/
+var/
+wheels/
+share/python-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/
+.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
+
+# 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
+
+# poetry
+#   Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
+#   This is especially recommended for binary packages to ensure reproducibility, and is more
+#   commonly ignored for libraries.
+#   https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
+#poetry.lock
+
+# pdm
+#   Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
+#pdm.lock
+#   pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
+#   in version control.
+#   https://pdm.fming.dev/#use-with-ide
+.pdm.toml
+
+# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
+__pypackages__/
+
+# Celery stuff
+celerybeat-schedule
+celerybeat.pid
+
+# 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
+
+# mypy
+.mypy_cache/
+.dmypy.json
+dmypy.json
+
+# Pyre type checker
+.pyre/
+
+# pytype static type analyzer
+.pytype/
+
+# Cython debug symbols
+cython_debug/
+
+# PyCharm
+#  JetBrains specific template is maintained in a separate JetBrains.gitignore that can
+#  be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
+#  and can be added to the global gitignore or merged into this file.  For a more nuclear
+#  option (not recommended) you can uncomment the following to ignore the entire idea folder.
+#.idea/
diff --git a/pyproject.toml b/pyproject.toml
new file mode 100644
index 0000000..67a5d02
--- /dev/null
+++ b/pyproject.toml
@@ -0,0 +1,35 @@
+[build-system]
+requires = ["wheel", "setuptools"]
+build-backend = "setuptools.build_meta"
+
+[project]
+name = "quantestpy"
+version = "0.1.0"
+license = { text = "Apache 2.0"}
+description = "Software for testing quantum computing programs."
+authors = [{name="Quantestpy Development Team"}]
+requires-python = ">=3.7"
+dependencies = [
+  "numpy == 1.*"
+]
+
+[project.urls]
+homepage ="https://github.com/QuantestPy/quantestpy"
+repository = "https://github.com/QuantestPy/quantestpy"
+
+[project.optional-dependencies]
+ci = [
+  "flake8 == 5.*",
+  "isort == 5.*",
+  "flake8-pyproject"
+]
+qiskit = [
+  "qiskit == 0.*"
+]
+
+[tool.setuptools]
+include-package-data = true
+zip-safe = false
+
+[tool.flake8]
+per-file-ignores = "__init__.py:F401"
diff --git a/requirements.txt b/requirements.txt
deleted file mode 100644
index 6e241c6..0000000
--- a/requirements.txt
+++ /dev/null
@@ -1,1 +0,0 @@
-numpy == 1.*
diff --git a/setup.py b/setup.py
deleted file mode 100644
index 929d160..0000000
--- a/setup.py
+++ /dev/null
@@ -1,20 +0,0 @@
-from setuptools import setup
-
-
-def _requires_from_file(filename):
-    return open(filename).read().splitlines()
-
-
-setup(
-    name="quantestpy",
-    version="0.1.0",
-    license="Apache 2.0",
-    description="Software for testing quantum computing programs.",
-    author="Quantestpy Development Team",
-    url="https://github.com/QuantestPy/quantestpy",
-    packages=["quantestpy"],
-    include_package_data=True,
-    zip_safe=False,
-    python_requires=">=3.7",
-    install_requires=_requires_from_file("requirements.txt")
-)


Test patch:
diff --git a/test/requirements.txt b/test/requirements.txt
deleted file mode 100644
index c5bd44e..0000000
--- a/test/requirements.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-numpy == 1.*
-flake8 == 5.*
-isort == 5.*
\ No newline at end of file
diff --git a/test/with_qiskit/requirements.txt b/test/with_qiskit/requirements.txt
deleted file mode 100644
index ba7453a..0000000
--- a/test/with_qiskit/requirements.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-numpy == 1.*
-qiskit == 0.*