From b3ed7bd739b2b11b0f964566732f0163e12acf3d Mon Sep 17 00:00:00 2001 From: Nathan Hui Date: Tue, 8 Aug 2023 16:26:46 -0700 Subject: [PATCH 1/6] feat: Adds license file --- LICENSE | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..01b92f5 --- /dev/null +++ b/LICENSE @@ -0,0 +1,7 @@ +Copyright 2023 UC San Diego + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file From f89a3aac1dafda631186eb084d096c18640188a6 Mon Sep 17 00:00:00 2001 From: Nathan Hui Date: Tue, 8 Aug 2023 16:27:22 -0700 Subject: [PATCH 2/6] chore: Adds version --- example_package/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/example_package/__init__.py b/example_package/__init__.py index e69de29..541f859 100644 --- a/example_package/__init__.py +++ b/example_package/__init__.py @@ -0,0 +1 @@ +__version__ = '0.1.0' \ No newline at end of file From 9d51cc3686c1635f21714c293f9cd3141904fb22 Mon Sep 17 00:00:00 2001 From: Nathan Hui Date: Tue, 8 Aug 2023 16:27:46 -0700 Subject: [PATCH 3/6] feat: Transition to pyproject.toml --- pyproject.toml | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++ setup.py | 25 ----------------- 2 files changed, 74 insertions(+), 25 deletions(-) create mode 100644 pyproject.toml delete mode 100644 setup.py diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..073435e --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,74 @@ +[build-system] +requires = ['setuptools'] +build-backend = 'setuptools.build_meta' + +[project] +name = 'example_package' +authors = [ + {name = 'UCSD Engineers for Exploration', email = 'e4e@ucsd.edu'}, +] +description = '' +readme = 'REAME.md' +requires-python = '>=3.8' +keywords = [] +license = {file = 'LICENSE'} +dependencies = [ +] +dynamic = ['version'] + +[project.scripts] +ExamplePythonConsoleScript = 'example_package.example_module:exampleEntryPoint' + +[tool.semantic_release] +version_variables = ["example_package.__init__.py:__version__"] +assets = [] +commit_message = "{version}\n\nAutomatically generated by python-semantic-release" +commit_parser = "angular" +logging_use_named_masks = false +major_on_zero = true +tag_format = "v{version}" + +[tool.semantic_release.branches.main] +match = "(main|master)" +prerelease = false +prerelease_token = "rc" + +[tool.semantic_release.changelog] +template_dir = "templates" +changelog_file = "CHANGELOG.md" +exclude_commit_patterns = [] + +[tool.semantic_release.changelog.environment] +block_start_string = "{%" +block_end_string = "%}" +variable_start_string = "{{" +variable_end_string = "}}" +comment_start_string = "{#" +comment_end_string = "#}" +trim_blocks = false +lstrip_blocks = false +newline_sequence = "\n" +keep_trailing_newline = false +extensions = [] +autoescape = true + +[tool.semantic_release.commit_author] +env = "GIT_COMMIT_AUTHOR" +default = "semantic-release " + +[tool.semantic_release.commit_parser_options] +allowed_tags = ["build", "chore", "ci", "docs", "feat", "fix", "perf", "style", "refactor", "test"] +minor_tags = ["feat"] +patch_tags = ["fix", "perf"] + +[tool.semantic_release.remote] +name = "origin" +type = "github" +ignore_token_for_push = false + +[tool.semantic_release.remote.token] +env = "GH_TOKEN" + +[tool.semantic_release.publish] +dist_glob_patterns = ["dist/*"] +upload_to_vcs_release = true \ No newline at end of file diff --git a/setup.py b/setup.py deleted file mode 100644 index a3519e3..0000000 --- a/setup.py +++ /dev/null @@ -1,25 +0,0 @@ -"""Example setup file -""" -from setuptools import setup, find_packages - -setup( - name='example_package', - version='0.0.0.1', - author='UCSD Engineers for Exploration', - author_email='e4e@ucsd.edu', - entry_points={ - 'console_scripts': [ - 'ExamplePythonConsoleScript = example_package.example_module:exampleEntryPoint' - ] - }, - packages=find_packages(), - install_requires=[], - extras_require={ - 'dev': [ - 'pytest', - 'coverage', - 'pylint', - 'wheel', - ] - }, -) From abb978454cfd5bf7f88656a61bb6cb446fb5a936 Mon Sep 17 00:00:00 2001 From: Nathan Hui Date: Tue, 8 Aug 2023 16:27:59 -0700 Subject: [PATCH 4/6] feat: Adds workflow --- .github/workflows/release.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..3349c8a --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,24 @@ +name: Semantic Release + +on: + push: + branches: + - main + +jobs: + release: + runs-on: ubuntu-latest + concurrency: release + permissions: + id-token: write + contents: write + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Python Semantic Release + uses: python-semantic-release/python-semantic-release@master + with: + github_token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file From 02e5d3cb5224e6a1332ac410de030b90ef0fcd91 Mon Sep 17 00:00:00 2001 From: Nathan Hui Date: Tue, 8 Aug 2023 16:30:25 -0700 Subject: [PATCH 5/6] fix: Fixes linting errors --- example_package/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/example_package/__init__.py b/example_package/__init__.py index 541f859..6abe988 100644 --- a/example_package/__init__.py +++ b/example_package/__init__.py @@ -1 +1,3 @@ -__version__ = '0.1.0' \ No newline at end of file +'''Example Package +''' +__version__ = '0.1.0' From 755156b560d07e28847333a4623b13b977197e6c Mon Sep 17 00:00:00 2001 From: Nathan Hui Date: Wed, 8 Nov 2023 00:09:52 -0800 Subject: [PATCH 6/6] fix: Fixes pyproject.toml for semantic release --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 073435e..f9464d2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -20,7 +20,7 @@ dynamic = ['version'] ExamplePythonConsoleScript = 'example_package.example_module:exampleEntryPoint' [tool.semantic_release] -version_variables = ["example_package.__init__.py:__version__"] +version_variables = ["example_package/__init__.py:__version__"] assets = [] commit_message = "{version}\n\nAutomatically generated by python-semantic-release" commit_parser = "angular" @@ -71,4 +71,4 @@ env = "GH_TOKEN" [tool.semantic_release.publish] dist_glob_patterns = ["dist/*"] -upload_to_vcs_release = true \ No newline at end of file +upload_to_vcs_release = true