From 1d8cdb6af9a7e91e2563da2252860aed1412dcad Mon Sep 17 00:00:00 2001 From: showa_yojyo <2386769+showa-yojyo@users.noreply.github.com> Date: Fri, 18 Oct 2024 11:54:21 +0900 Subject: [PATCH] Use the build tool. #17 --- Pipfile | 1 + Pipfile.lock | 30 ++++++++++++++++++++++++++++-- README.md | 25 +++++++++++++++++++++++++ pyproject.toml | 10 +++++----- 4 files changed, 59 insertions(+), 7 deletions(-) diff --git a/Pipfile b/Pipfile index 39671c4..e4f959b 100644 --- a/Pipfile +++ b/Pipfile @@ -4,6 +4,7 @@ verify_ssl = true name = "pypi" [packages] +build = "*" [dev-packages] diff --git a/Pipfile.lock b/Pipfile.lock index e1f0db7..9dc24de 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "c906db43586dcdd914f5d2ce90744dafb574bb37115ecc20796212395fdae4ba" + "sha256": "ebf7dd7ee029431ecafa8d26a35bbd285e2df77b03d452e5e1cacb1e1b2651a7" }, "pipfile-spec": 6, "requires": { @@ -16,6 +16,32 @@ } ] }, - "default": {}, + "default": { + "build": { + "hashes": [ + "sha256:1d61c0887fa860c01971625baae8bdd338e517b836a2f70dd1f7aa3a6b2fc5b5", + "sha256:b36993e92ca9375a219c99e606a122ff365a760a2d4bba0caa09bd5278b608b7" + ], + "index": "pypi", + "markers": "python_version >= '3.8'", + "version": "==1.2.2.post1" + }, + "packaging": { + "hashes": [ + "sha256:026ed72c8ed3fcce5bf8950572258698927fd1dbda10a5e981cdf0ac37f4f002", + "sha256:5b8f2217dbdbd2f7f384c41c628544e6d52f2d0f53c6d0c3ea61aa5d1d7ff124" + ], + "markers": "python_version >= '3.8'", + "version": "==24.1" + }, + "pyproject-hooks": { + "hashes": [ + "sha256:1e859bd5c40fae9448642dd871adf459e5e2084186e8d2c2a79a824c970da1f8", + "sha256:9e5c6bfa8dcc30091c74b0cf803c81fdd29d94f01992a7707bc97babb1141913" + ], + "markers": "python_version >= '3.7'", + "version": "==1.2.0" + } + }, "develop": {} } diff --git a/README.md b/README.md index e2f6a9d..3e7bf59 100644 --- a/README.md +++ b/README.md @@ -47,6 +47,31 @@ For example: OK (skipped=1) +### Build the Package + +To build the package, install the required packages and run the build command +with Pipenv. The generated files will be in the `dist` directory. For example: + + $ cd $REPOSITORY_ROOT + $ pipenv sync + To activate this project's virtualenv, run pipenv shell. + Alternatively, run a command inside the virtualenv with pipenv run. + Installing dependencies from Pipfile.lock (xxxxxx)... + All dependencies are now up-to-date! + $ pipenv run python -m build + * Creating isolated environment: venv+pip... + * Installing packages in isolated environment: + - hatchling + * Getting build dependencies for sdist... + * Building sdist... + * Building wheel from sdist + * Creating isolated environment: venv+pip... + * Installing packages in isolated environment: + - hatchling + * Getting build dependencies for wheel... + * Building wheel... + Successfully built dqutils-x.y.z.tar.gz and dqutils-x.y.z-py3-none-any.whl + ## Usage ### View Texts diff --git a/pyproject.toml b/pyproject.toml index 7a980f5..4065926 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -130,10 +130,10 @@ Source = "https://github.com/showa-yojyo/dqutils/" # Choosing a build backend: # https://packaging.python.org/en/latest/tutorials/packaging-projects/#choosing-a-build-backend -# [build-system] -# +[build-system] + # A list of packages that are needed to build your package: -# requires = ["hatchling"] -# +requires = ["hatchling"] + # The name of the Python object that frontends will use to perform the build: -# build-backend = "hatchling.build" +build-backend = "hatchling.build"