diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml new file mode 100644 index 0000000..ada2b5c --- /dev/null +++ b/.github/workflows/pytest.yml @@ -0,0 +1,33 @@ +name: pytest + +on: [push, workflow_dispatch] + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.8", "3.9", "3.10", "3.11"] + steps: + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v3 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install pytest coverage + pip install . + - name: Test + run: | + coverage run -m pytest tests/ + - name: Generate Report + run: | + coverage html + - name: Upload report + uses: actions/upload-artifact@v3 + with: + name: coverage-report + path: | + htmlcov/* \ No newline at end of file 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 diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..8886060 --- /dev/null +++ b/LICENSE @@ -0,0 +1,11 @@ +This software is Copyright © 2024 The Regents of the University of California. All Rights Reserved. Permission to copy, modify, and distribute this software and its documentation for educational, research and non-profit purposes, without fee, and without a written agreement is hereby granted, provided that the above copyright notice, this paragraph and the following three paragraphs appear in all copies. Permission to make commercial use of this software may be obtained by contacting: + +Office of Innovation and Commercialization +9500 Gilman Drive, Mail Code 0910 +University of California +La Jolla, CA 92093-0910 +innovation@ucsd.edu + +This software program and documentation are copyrighted by The Regents of the University of California. The software program and documentation are supplied “as is”, without any accompanying services from The Regents. The Regents does not warrant that the operation of the program will be uninterrupted or error-free. The end-user understands that the program was developed for research purposes and is advised not to rely exclusively on the program for any reason. + +IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN “AS IS” BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. diff --git a/example_package/__init__.py b/example_package/__init__.py index e69de29..6abe988 100644 --- a/example_package/__init__.py +++ b/example_package/__init__.py @@ -0,0 +1,3 @@ +'''Example Package +''' +__version__ = '0.1.0' diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..f9464d2 --- /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 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', - ] - }, -)