From ef1f603fc0ca8dfaa86a080255ae35e595e18ea2 Mon Sep 17 00:00:00 2001 From: Jo Basevi Date: Tue, 3 Dec 2024 19:04:47 +1100 Subject: [PATCH 01/11] Add CI/CD workflows for building conda package and running tests --- .github/workflows/CD.yml | 37 ++++++++++++ .github/workflows/CI.yml | 120 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 157 insertions(+) create mode 100644 .github/workflows/CD.yml create mode 100644 .github/workflows/CI.yml diff --git a/.github/workflows/CD.yml b/.github/workflows/CD.yml new file mode 100644 index 0000000..0865016 --- /dev/null +++ b/.github/workflows/CD.yml @@ -0,0 +1,37 @@ +name: CD + +on: + push: + tags: + - '*' + +jobs: + + conda: + name: Build with conda and upload + runs-on: ubuntu-latest + steps: + - name: Checkout source + uses: actions/checkout@v4 + with: + fetch-tags: true + fetch-depth: 0 + + - name: Setup conda environment + uses: conda-incubator/setup-miniconda@11b562958363ec5770fef326fe8ef0366f8cbf8a + with: + miniconda-version: "latest" + python-version: ${{ vars.PY_VERSION }} + environment-file: .conda/env_build.yml + auto-update-conda: false + auto-activate-base: false + show-channel-urls: true + + - name: Build and upload the conda package + uses: uibcdf/action-build-and-upload-conda-packages@c6e7a90ad5e599d6cde76e130db4ee52ad733ecf + with: + meta_yaml_dir: .conda + python-version: ${{ vars.PY_VERSION }} + user: accessnri + label: master + token: ${{ secrets.ANACONDA_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml new file mode 100644 index 0000000..31969f4 --- /dev/null +++ b/.github/workflows/CI.yml @@ -0,0 +1,120 @@ +# Run CI tests +name: CI + +# Controls when the action will run. +on: + # Triggers the workflow on push or pull request events but only for the master branch + push: + branches: main + pull_request: + branches: main + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +jobs: + # JOB to run change in the build files + changes: + runs-on: ubuntu-latest + # Required permissions + permissions: + pull-requests: read + # Set job outputs to values from filter step + outputs: + files: ${{ steps.filter.outputs.files }} + steps: + - name: Checkout code + uses: actions/checkout@v4.1.7 + + - name: Filter files + uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 #v3.0.2 + id: filter + with: + filters: | + files: + - 'pyproject.toml' + - 'setup.cfg' + - '.conda/env_build.yml' + - '.conda/meta.yml' + + verify-conda-build: + name: Conda Build + runs-on: ubuntu-latest + needs: changes + # Only run if there are changes in the build files + if: ${{ needs.changes.outputs.files == 'true' }} + steps: + - uses: actions/checkout@v4 + + - name: Setup conda build environment + uses: conda-incubator/setup-miniconda@a4260408e20b96e80095f42ff7f1a15b27dd94ca # v3.0.4 + with: + miniconda-version: "latest" + python-version: vars.PY_VERSION + environment-file: .conda/env_build.yml + auto-activate-base: false + auto-update-conda: false + show-channel-urls: true + + - name: Verify conda recipe + shell: bash -el {0} + run: conda-verify .conda --ignore C2105,C2122 + + - name: Run conda build + shell: bash -el {0} + run: | + conda build . --no-anaconda-upload --output-folder=./build -c conda-forge -c accessnri -c coecms + + - name: Verify conda package + shell: bash -el {0} + run: conda-verify ./build/noarch/*.tar.bz2 --ignore C1105,C1115,C1141 + + tests: + name: Tests + runs-on: ubuntu-latest + strategy: + fail-fast: true + matrix: + python-version: ["3.10", "3.11", "3.12"] + steps: + - name: Checkout code + uses: actions/checkout@v4.1.7 + + - name: Setup conda environment + uses: conda-incubator/setup-miniconda@a4260408e20b96e80095f42ff7f1a15b27dd94ca # v3.0.4 + with: + miniconda-version: "latest" + python-version: ${{ matrix.python-version }} + environment-file: .conda/env_dev.yml + activate-environment: yamanifest-dev + auto-update-conda: false + auto-activate-base: false + show-channel-urls: true + + - name: Install source + shell: bash -l {0} + run: python3 -m pip install --no-deps --no-build-isolation -e . + + - name: List installed packages + shell: bash -l {0} + run: conda list + + # - name: Lint # TODO: Add back in linting + # shell: bash -l {0} + # run: pylint --extension-pkg-whitelist=netCDF4 --ignored-modules=yamanifest -E yamanifest + + - name: Entrypoint test of driver script + shell: bash -l {0} + run: yamf --help + + - name: Run tests + shell: bash -l {0} + run: | + python -m pytest --cov=yamanifest --cov-report=html -s # test + + # - name: Upload code coverage + # # Only upload once for the installed version + # if: ${{ matrix.python-version == vars.PY_VERSION }} + # uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 #v4.6.0 + # with: + # token: ${{ secrets.codecov_token }} + # files: ./coverage.xml \ No newline at end of file From ddfe445e57c6b1f465ffe5a8f19a8de802fd7dfd Mon Sep 17 00:00:00 2001 From: Jo Basevi Date: Tue, 3 Dec 2024 19:08:48 +1100 Subject: [PATCH 02/11] Update conda environment and meta files with dependencies and add a pyproject.toml --- .conda/env_build.yml | 11 ++++ .../dev-environment.yml => .conda/env_dev.yml | 7 +++ .conda/meta.yaml | 45 +++++++++++++++++ conda/meta.yaml | 41 --------------- pyproject.toml | 50 +++++++++++++++++++ 5 files changed, 113 insertions(+), 41 deletions(-) create mode 100644 .conda/env_build.yml rename conda/dev-environment.yml => .conda/env_dev.yml (58%) create mode 100644 .conda/meta.yaml delete mode 100644 conda/meta.yaml create mode 100644 pyproject.toml diff --git a/.conda/env_build.yml b/.conda/env_build.yml new file mode 100644 index 0000000..a5dcc92 --- /dev/null +++ b/.conda/env_build.yml @@ -0,0 +1,11 @@ +channels: + - accessnri + - conda-forge + - coecms + - nodefaults + +dependencies: + - anaconda-client + - conda-build + - conda-verify + - versioneer \ No newline at end of file diff --git a/conda/dev-environment.yml b/.conda/env_dev.yml similarity index 58% rename from conda/dev-environment.yml rename to .conda/env_dev.yml index 6d3fe80..f9744a9 100644 --- a/conda/dev-environment.yml +++ b/.conda/env_dev.yml @@ -10,3 +10,10 @@ dependencies: - pbr - netcdf4 - libnetcdf + - six + - PyYAML + - nchash>=0.1.5 + - pytest + - pytest-cov + - pylint + - versioneer diff --git a/.conda/meta.yaml b/.conda/meta.yaml new file mode 100644 index 0000000..72dc9ca --- /dev/null +++ b/.conda/meta.yaml @@ -0,0 +1,45 @@ +{% set version = load_setup_py_data(setup_file='../setup.py', from_recipe_dir=True).get('version') %} +{% set project = load_file_data('../pyproject.toml', from_recipe_dir=True).get('project') %} + +package: + name: {{ project.get('name') }} + version: "{{ version }}" + +build: + noarch: python + number: 0 + script: "python3 -m pip install . -vv" + entry_points: + {% for name, script in project.get('scripts').items() %} + - {{ name }} = {{ script }} + {% endfor %} + +source: + path: ../ + +requirements: + build: + - python + - pip + - setuptools >=61.0.0 + - versioneer + run: + - python + - six + - pyyaml + - nchash + +test: + imports: + - yamanifest + commands: + {% for name, script in project.get('scripts').items() %} + - {{ name }} --help + {% endfor %} + +about: + home: {{ project.get('urls').get('Repository') }} + license: Apache Software + license_file: LICENSE + summary: {{ project.get('description') }} + license_family: Apache \ No newline at end of file diff --git a/conda/meta.yaml b/conda/meta.yaml deleted file mode 100644 index 816f776..0000000 --- a/conda/meta.yaml +++ /dev/null @@ -1,41 +0,0 @@ -package: - name: yamanifest - version: {{ GIT_DESCRIBE_TAG }} - -build: - number: {{ GIT_DESCRIBE_NUMBER }} - string: {{ GIT_BUILD_STR }} - -source: - git_url: ../ - -build: - script: "python -m pip install . --no-deps" - noarch: python - -requirements: - build: - - python - - pip - - pbr - run: - - python - - six - - pyyaml - - nchash - -test: - source_files: - - setup.cfg - - conftest.py - - test - requires: - - pytest - commands: - - py.test -s - -about: - home: https://github.com/aidanheerdegen/yamanifest - license: Apache 2.0 - license_file: LICENSE-2.0.txt - summary: General YAML manifest format diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..6347692 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,50 @@ +[project] +name = "yamanifest" +authors = [ + {name = "Aidan Heerdegen", email="aidan.heerdegen@anu.edu.au"}, +] +maintainers = [ + { name = "ACCESS-NRI", email = "access.nri@anu.edu.au" } +] +description = "General YAML manifest format" +license = { file = "LICENSE" } +readme = "README.rst" +dynamic = ["version"] +requires-python = ">=3.10" +dependencies = [ + "PyYAML", + "nchash>=0.1.5", + "six" +] + +# [project.optional-dependencies] +# test = [ +# "pytest", +# "pylint", +# "Sphinx" +# ] + +[project.scripts] +yamf = "yamanifest.yamf:main_argv" + +[project.urls] +Repository = "https://github.com/ACCESS-NRI/yamanifest" + +[build-system] +build-backend = "setuptools.build_meta" +requires = [ + "setuptools>64", + "versioneer[toml]" +] + +[tool.setuptools.packages.find] +include = ["yamanifest*"] +namespaces = false + +[tool.versioneer] +VCS = "git" +style = "pep440" +versionfile_source = "yamanifest/_version.py" +versionfile_build = "yamanifest/_version.py" +tag_prefix = "" +parentdir_prefix = "yamanifest-" \ No newline at end of file From 8a997ded5b1b462581694ae4fb4e10361574ebaa Mon Sep 17 00:00:00 2001 From: Jo Basevi Date: Tue, 3 Dec 2024 19:10:16 +1100 Subject: [PATCH 03/11] Add in versioneer files for dynamic versions --- LICENSE-2.0.txt => LICENSE | 0 setup.py | 11 +- yamanifest/_version.py | 683 +++++++++++++++++++++++++++++++++++++ 3 files changed, 687 insertions(+), 7 deletions(-) rename LICENSE-2.0.txt => LICENSE (100%) create mode 100644 yamanifest/_version.py diff --git a/LICENSE-2.0.txt b/LICENSE similarity index 100% rename from LICENSE-2.0.txt rename to LICENSE diff --git a/setup.py b/setup.py index 95f3c46..21c0227 100644 --- a/setup.py +++ b/setup.py @@ -1,12 +1,9 @@ #!/usr/bin/env python -# -# Uses Python Build Reasonableness https://docs.openstack.org/developer/pbr/ -# Add configuration to `setup.cfg` from setuptools import setup +import versioneer setup( - setup_requires=['pbr>=1.9', 'setuptools>=17.1'], - pbr=True, - ) - + version=versioneer.get_version(), + cmdclass=versioneer.get_cmdclass(), +) diff --git a/yamanifest/_version.py b/yamanifest/_version.py new file mode 100644 index 0000000..b00b7f8 --- /dev/null +++ b/yamanifest/_version.py @@ -0,0 +1,683 @@ + +# This file helps to compute a version number in source trees obtained from +# git-archive tarball (such as those provided by githubs download-from-tag +# feature). Distribution tarballs (built by setup.py sdist) and build +# directories (produced by setup.py build) will contain a much shorter file +# that just contains the computed version number. + +# This file is released into the public domain. +# Generated by versioneer-0.29 +# https://github.com/python-versioneer/python-versioneer + +"""Git implementation of _version.py.""" + +import errno +import os +import re +import subprocess +import sys +from typing import Any, Callable, Dict, List, Optional, Tuple +import functools + + +def get_keywords() -> Dict[str, str]: + """Get the keywords needed to look up the version information.""" + # these strings will be replaced by git during git-archive. + # setup.py/versioneer.py will grep for the variable names, so they must + # each be defined on a line of their own. _version.py will just call + # get_keywords(). + git_refnames = "$Format:%d$" + git_full = "$Format:%H$" + git_date = "$Format:%ci$" + keywords = {"refnames": git_refnames, "full": git_full, "date": git_date} + return keywords + + +class VersioneerConfig: + """Container for Versioneer configuration parameters.""" + + VCS: str + style: str + tag_prefix: str + parentdir_prefix: str + versionfile_source: str + verbose: bool + + +def get_config() -> VersioneerConfig: + """Create, populate and return the VersioneerConfig() object.""" + # these strings are filled in when 'setup.py versioneer' creates + # _version.py + cfg = VersioneerConfig() + cfg.VCS = "git" + cfg.style = "pep440" + cfg.tag_prefix = "" + cfg.parentdir_prefix = "yamanifest-" + cfg.versionfile_source = "yamanifest/_version.py" + cfg.verbose = False + return cfg + + +class NotThisMethod(Exception): + """Exception raised if a method is not valid for the current scenario.""" + + +LONG_VERSION_PY: Dict[str, str] = {} +HANDLERS: Dict[str, Dict[str, Callable]] = {} + + +def register_vcs_handler(vcs: str, method: str) -> Callable: # decorator + """Create decorator to mark a method as the handler of a VCS.""" + def decorate(f: Callable) -> Callable: + """Store f in HANDLERS[vcs][method].""" + if vcs not in HANDLERS: + HANDLERS[vcs] = {} + HANDLERS[vcs][method] = f + return f + return decorate + + +def run_command( + commands: List[str], + args: List[str], + cwd: Optional[str] = None, + verbose: bool = False, + hide_stderr: bool = False, + env: Optional[Dict[str, str]] = None, +) -> Tuple[Optional[str], Optional[int]]: + """Call the given command(s).""" + assert isinstance(commands, list) + process = None + + popen_kwargs: Dict[str, Any] = {} + if sys.platform == "win32": + # This hides the console window if pythonw.exe is used + startupinfo = subprocess.STARTUPINFO() + startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW + popen_kwargs["startupinfo"] = startupinfo + + for command in commands: + try: + dispcmd = str([command] + args) + # remember shell=False, so use git.cmd on windows, not just git + process = subprocess.Popen([command] + args, cwd=cwd, env=env, + stdout=subprocess.PIPE, + stderr=(subprocess.PIPE if hide_stderr + else None), **popen_kwargs) + break + except OSError as e: + if e.errno == errno.ENOENT: + continue + if verbose: + print("unable to run %s" % dispcmd) + print(e) + return None, None + else: + if verbose: + print("unable to find command, tried %s" % (commands,)) + return None, None + stdout = process.communicate()[0].strip().decode() + if process.returncode != 0: + if verbose: + print("unable to run %s (error)" % dispcmd) + print("stdout was %s" % stdout) + return None, process.returncode + return stdout, process.returncode + + +def versions_from_parentdir( + parentdir_prefix: str, + root: str, + verbose: bool, +) -> Dict[str, Any]: + """Try to determine the version from the parent directory name. + + Source tarballs conventionally unpack into a directory that includes both + the project name and a version string. We will also support searching up + two directory levels for an appropriately named parent directory + """ + rootdirs = [] + + for _ in range(3): + dirname = os.path.basename(root) + if dirname.startswith(parentdir_prefix): + return {"version": dirname[len(parentdir_prefix):], + "full-revisionid": None, + "dirty": False, "error": None, "date": None} + rootdirs.append(root) + root = os.path.dirname(root) # up a level + + if verbose: + print("Tried directories %s but none started with prefix %s" % + (str(rootdirs), parentdir_prefix)) + raise NotThisMethod("rootdir doesn't start with parentdir_prefix") + + +@register_vcs_handler("git", "get_keywords") +def git_get_keywords(versionfile_abs: str) -> Dict[str, str]: + """Extract version information from the given file.""" + # the code embedded in _version.py can just fetch the value of these + # keywords. When used from setup.py, we don't want to import _version.py, + # so we do it with a regexp instead. This function is not used from + # _version.py. + keywords: Dict[str, str] = {} + try: + with open(versionfile_abs, "r") as fobj: + for line in fobj: + if line.strip().startswith("git_refnames ="): + mo = re.search(r'=\s*"(.*)"', line) + if mo: + keywords["refnames"] = mo.group(1) + if line.strip().startswith("git_full ="): + mo = re.search(r'=\s*"(.*)"', line) + if mo: + keywords["full"] = mo.group(1) + if line.strip().startswith("git_date ="): + mo = re.search(r'=\s*"(.*)"', line) + if mo: + keywords["date"] = mo.group(1) + except OSError: + pass + return keywords + + +@register_vcs_handler("git", "keywords") +def git_versions_from_keywords( + keywords: Dict[str, str], + tag_prefix: str, + verbose: bool, +) -> Dict[str, Any]: + """Get version information from git keywords.""" + if "refnames" not in keywords: + raise NotThisMethod("Short version file found") + date = keywords.get("date") + if date is not None: + # Use only the last line. Previous lines may contain GPG signature + # information. + date = date.splitlines()[-1] + + # git-2.2.0 added "%cI", which expands to an ISO-8601 -compliant + # datestamp. However we prefer "%ci" (which expands to an "ISO-8601 + # -like" string, which we must then edit to make compliant), because + # it's been around since git-1.5.3, and it's too difficult to + # discover which version we're using, or to work around using an + # older one. + date = date.strip().replace(" ", "T", 1).replace(" ", "", 1) + refnames = keywords["refnames"].strip() + if refnames.startswith("$Format"): + if verbose: + print("keywords are unexpanded, not using") + raise NotThisMethod("unexpanded keywords, not a git-archive tarball") + refs = {r.strip() for r in refnames.strip("()").split(",")} + # starting in git-1.8.3, tags are listed as "tag: foo-1.0" instead of + # just "foo-1.0". If we see a "tag: " prefix, prefer those. + TAG = "tag: " + tags = {r[len(TAG):] for r in refs if r.startswith(TAG)} + if not tags: + # Either we're using git < 1.8.3, or there really are no tags. We use + # a heuristic: assume all version tags have a digit. The old git %d + # expansion behaves like git log --decorate=short and strips out the + # refs/heads/ and refs/tags/ prefixes that would let us distinguish + # between branches and tags. By ignoring refnames without digits, we + # filter out many common branch names like "release" and + # "stabilization", as well as "HEAD" and "master". + tags = {r for r in refs if re.search(r'\d', r)} + if verbose: + print("discarding '%s', no digits" % ",".join(refs - tags)) + if verbose: + print("likely tags: %s" % ",".join(sorted(tags))) + for ref in sorted(tags): + # sorting will prefer e.g. "2.0" over "2.0rc1" + if ref.startswith(tag_prefix): + r = ref[len(tag_prefix):] + # Filter out refs that exactly match prefix or that don't start + # with a number once the prefix is stripped (mostly a concern + # when prefix is '') + if not re.match(r'\d', r): + continue + if verbose: + print("picking %s" % r) + return {"version": r, + "full-revisionid": keywords["full"].strip(), + "dirty": False, "error": None, + "date": date} + # no suitable tags, so version is "0+unknown", but full hex is still there + if verbose: + print("no suitable tags, using unknown + full revision id") + return {"version": "0+unknown", + "full-revisionid": keywords["full"].strip(), + "dirty": False, "error": "no suitable tags", "date": None} + + +@register_vcs_handler("git", "pieces_from_vcs") +def git_pieces_from_vcs( + tag_prefix: str, + root: str, + verbose: bool, + runner: Callable = run_command +) -> Dict[str, Any]: + """Get version from 'git describe' in the root of the source tree. + + This only gets called if the git-archive 'subst' keywords were *not* + expanded, and _version.py hasn't already been rewritten with a short + version string, meaning we're inside a checked out source tree. + """ + GITS = ["git"] + if sys.platform == "win32": + GITS = ["git.cmd", "git.exe"] + + # GIT_DIR can interfere with correct operation of Versioneer. + # It may be intended to be passed to the Versioneer-versioned project, + # but that should not change where we get our version from. + env = os.environ.copy() + env.pop("GIT_DIR", None) + runner = functools.partial(runner, env=env) + + _, rc = runner(GITS, ["rev-parse", "--git-dir"], cwd=root, + hide_stderr=not verbose) + if rc != 0: + if verbose: + print("Directory %s not under git control" % root) + raise NotThisMethod("'git rev-parse --git-dir' returned error") + + # if there is a tag matching tag_prefix, this yields TAG-NUM-gHEX[-dirty] + # if there isn't one, this yields HEX[-dirty] (no NUM) + describe_out, rc = runner(GITS, [ + "describe", "--tags", "--dirty", "--always", "--long", + "--match", f"{tag_prefix}[[:digit:]]*" + ], cwd=root) + # --long was added in git-1.5.5 + if describe_out is None: + raise NotThisMethod("'git describe' failed") + describe_out = describe_out.strip() + full_out, rc = runner(GITS, ["rev-parse", "HEAD"], cwd=root) + if full_out is None: + raise NotThisMethod("'git rev-parse' failed") + full_out = full_out.strip() + + pieces: Dict[str, Any] = {} + pieces["long"] = full_out + pieces["short"] = full_out[:7] # maybe improved later + pieces["error"] = None + + branch_name, rc = runner(GITS, ["rev-parse", "--abbrev-ref", "HEAD"], + cwd=root) + # --abbrev-ref was added in git-1.6.3 + if rc != 0 or branch_name is None: + raise NotThisMethod("'git rev-parse --abbrev-ref' returned error") + branch_name = branch_name.strip() + + if branch_name == "HEAD": + # If we aren't exactly on a branch, pick a branch which represents + # the current commit. If all else fails, we are on a branchless + # commit. + branches, rc = runner(GITS, ["branch", "--contains"], cwd=root) + # --contains was added in git-1.5.4 + if rc != 0 or branches is None: + raise NotThisMethod("'git branch --contains' returned error") + branches = branches.split("\n") + + # Remove the first line if we're running detached + if "(" in branches[0]: + branches.pop(0) + + # Strip off the leading "* " from the list of branches. + branches = [branch[2:] for branch in branches] + if "master" in branches: + branch_name = "master" + elif not branches: + branch_name = None + else: + # Pick the first branch that is returned. Good or bad. + branch_name = branches[0] + + pieces["branch"] = branch_name + + # parse describe_out. It will be like TAG-NUM-gHEX[-dirty] or HEX[-dirty] + # TAG might have hyphens. + git_describe = describe_out + + # look for -dirty suffix + dirty = git_describe.endswith("-dirty") + pieces["dirty"] = dirty + if dirty: + git_describe = git_describe[:git_describe.rindex("-dirty")] + + # now we have TAG-NUM-gHEX or HEX + + if "-" in git_describe: + # TAG-NUM-gHEX + mo = re.search(r'^(.+)-(\d+)-g([0-9a-f]+)$', git_describe) + if not mo: + # unparsable. Maybe git-describe is misbehaving? + pieces["error"] = ("unable to parse git-describe output: '%s'" + % describe_out) + return pieces + + # tag + full_tag = mo.group(1) + if not full_tag.startswith(tag_prefix): + if verbose: + fmt = "tag '%s' doesn't start with prefix '%s'" + print(fmt % (full_tag, tag_prefix)) + pieces["error"] = ("tag '%s' doesn't start with prefix '%s'" + % (full_tag, tag_prefix)) + return pieces + pieces["closest-tag"] = full_tag[len(tag_prefix):] + + # distance: number of commits since tag + pieces["distance"] = int(mo.group(2)) + + # commit: short hex revision ID + pieces["short"] = mo.group(3) + + else: + # HEX: no tags + pieces["closest-tag"] = None + out, rc = runner(GITS, ["rev-list", "HEAD", "--left-right"], cwd=root) + pieces["distance"] = len(out.split()) # total number of commits + + # commit date: see ISO-8601 comment in git_versions_from_keywords() + date = runner(GITS, ["show", "-s", "--format=%ci", "HEAD"], cwd=root)[0].strip() + # Use only the last line. Previous lines may contain GPG signature + # information. + date = date.splitlines()[-1] + pieces["date"] = date.strip().replace(" ", "T", 1).replace(" ", "", 1) + + return pieces + + +def plus_or_dot(pieces: Dict[str, Any]) -> str: + """Return a + if we don't already have one, else return a .""" + if "+" in pieces.get("closest-tag", ""): + return "." + return "+" + + +def render_pep440(pieces: Dict[str, Any]) -> str: + """Build up version string, with post-release "local version identifier". + + Our goal: TAG[+DISTANCE.gHEX[.dirty]] . Note that if you + get a tagged build and then dirty it, you'll get TAG+0.gHEX.dirty + + Exceptions: + 1: no tags. git_describe was just HEX. 0+untagged.DISTANCE.gHEX[.dirty] + """ + if pieces["closest-tag"]: + rendered = pieces["closest-tag"] + if pieces["distance"] or pieces["dirty"]: + rendered += plus_or_dot(pieces) + rendered += "%d.g%s" % (pieces["distance"], pieces["short"]) + if pieces["dirty"]: + rendered += ".dirty" + else: + # exception #1 + rendered = "0+untagged.%d.g%s" % (pieces["distance"], + pieces["short"]) + if pieces["dirty"]: + rendered += ".dirty" + return rendered + + +def render_pep440_branch(pieces: Dict[str, Any]) -> str: + """TAG[[.dev0]+DISTANCE.gHEX[.dirty]] . + + The ".dev0" means not master branch. Note that .dev0 sorts backwards + (a feature branch will appear "older" than the master branch). + + Exceptions: + 1: no tags. 0[.dev0]+untagged.DISTANCE.gHEX[.dirty] + """ + if pieces["closest-tag"]: + rendered = pieces["closest-tag"] + if pieces["distance"] or pieces["dirty"]: + if pieces["branch"] != "master": + rendered += ".dev0" + rendered += plus_or_dot(pieces) + rendered += "%d.g%s" % (pieces["distance"], pieces["short"]) + if pieces["dirty"]: + rendered += ".dirty" + else: + # exception #1 + rendered = "0" + if pieces["branch"] != "master": + rendered += ".dev0" + rendered += "+untagged.%d.g%s" % (pieces["distance"], + pieces["short"]) + if pieces["dirty"]: + rendered += ".dirty" + return rendered + + +def pep440_split_post(ver: str) -> Tuple[str, Optional[int]]: + """Split pep440 version string at the post-release segment. + + Returns the release segments before the post-release and the + post-release version number (or -1 if no post-release segment is present). + """ + vc = str.split(ver, ".post") + return vc[0], int(vc[1] or 0) if len(vc) == 2 else None + + +def render_pep440_pre(pieces: Dict[str, Any]) -> str: + """TAG[.postN.devDISTANCE] -- No -dirty. + + Exceptions: + 1: no tags. 0.post0.devDISTANCE + """ + if pieces["closest-tag"]: + if pieces["distance"]: + # update the post release segment + tag_version, post_version = pep440_split_post(pieces["closest-tag"]) + rendered = tag_version + if post_version is not None: + rendered += ".post%d.dev%d" % (post_version + 1, pieces["distance"]) + else: + rendered += ".post0.dev%d" % (pieces["distance"]) + else: + # no commits, use the tag as the version + rendered = pieces["closest-tag"] + else: + # exception #1 + rendered = "0.post0.dev%d" % pieces["distance"] + return rendered + + +def render_pep440_post(pieces: Dict[str, Any]) -> str: + """TAG[.postDISTANCE[.dev0]+gHEX] . + + The ".dev0" means dirty. Note that .dev0 sorts backwards + (a dirty tree will appear "older" than the corresponding clean one), + but you shouldn't be releasing software with -dirty anyways. + + Exceptions: + 1: no tags. 0.postDISTANCE[.dev0] + """ + if pieces["closest-tag"]: + rendered = pieces["closest-tag"] + if pieces["distance"] or pieces["dirty"]: + rendered += ".post%d" % pieces["distance"] + if pieces["dirty"]: + rendered += ".dev0" + rendered += plus_or_dot(pieces) + rendered += "g%s" % pieces["short"] + else: + # exception #1 + rendered = "0.post%d" % pieces["distance"] + if pieces["dirty"]: + rendered += ".dev0" + rendered += "+g%s" % pieces["short"] + return rendered + + +def render_pep440_post_branch(pieces: Dict[str, Any]) -> str: + """TAG[.postDISTANCE[.dev0]+gHEX[.dirty]] . + + The ".dev0" means not master branch. + + Exceptions: + 1: no tags. 0.postDISTANCE[.dev0]+gHEX[.dirty] + """ + if pieces["closest-tag"]: + rendered = pieces["closest-tag"] + if pieces["distance"] or pieces["dirty"]: + rendered += ".post%d" % pieces["distance"] + if pieces["branch"] != "master": + rendered += ".dev0" + rendered += plus_or_dot(pieces) + rendered += "g%s" % pieces["short"] + if pieces["dirty"]: + rendered += ".dirty" + else: + # exception #1 + rendered = "0.post%d" % pieces["distance"] + if pieces["branch"] != "master": + rendered += ".dev0" + rendered += "+g%s" % pieces["short"] + if pieces["dirty"]: + rendered += ".dirty" + return rendered + + +def render_pep440_old(pieces: Dict[str, Any]) -> str: + """TAG[.postDISTANCE[.dev0]] . + + The ".dev0" means dirty. + + Exceptions: + 1: no tags. 0.postDISTANCE[.dev0] + """ + if pieces["closest-tag"]: + rendered = pieces["closest-tag"] + if pieces["distance"] or pieces["dirty"]: + rendered += ".post%d" % pieces["distance"] + if pieces["dirty"]: + rendered += ".dev0" + else: + # exception #1 + rendered = "0.post%d" % pieces["distance"] + if pieces["dirty"]: + rendered += ".dev0" + return rendered + + +def render_git_describe(pieces: Dict[str, Any]) -> str: + """TAG[-DISTANCE-gHEX][-dirty]. + + Like 'git describe --tags --dirty --always'. + + Exceptions: + 1: no tags. HEX[-dirty] (note: no 'g' prefix) + """ + if pieces["closest-tag"]: + rendered = pieces["closest-tag"] + if pieces["distance"]: + rendered += "-%d-g%s" % (pieces["distance"], pieces["short"]) + else: + # exception #1 + rendered = pieces["short"] + if pieces["dirty"]: + rendered += "-dirty" + return rendered + + +def render_git_describe_long(pieces: Dict[str, Any]) -> str: + """TAG-DISTANCE-gHEX[-dirty]. + + Like 'git describe --tags --dirty --always -long'. + The distance/hash is unconditional. + + Exceptions: + 1: no tags. HEX[-dirty] (note: no 'g' prefix) + """ + if pieces["closest-tag"]: + rendered = pieces["closest-tag"] + rendered += "-%d-g%s" % (pieces["distance"], pieces["short"]) + else: + # exception #1 + rendered = pieces["short"] + if pieces["dirty"]: + rendered += "-dirty" + return rendered + + +def render(pieces: Dict[str, Any], style: str) -> Dict[str, Any]: + """Render the given version pieces into the requested style.""" + if pieces["error"]: + return {"version": "unknown", + "full-revisionid": pieces.get("long"), + "dirty": None, + "error": pieces["error"], + "date": None} + + if not style or style == "default": + style = "pep440" # the default + + if style == "pep440": + rendered = render_pep440(pieces) + elif style == "pep440-branch": + rendered = render_pep440_branch(pieces) + elif style == "pep440-pre": + rendered = render_pep440_pre(pieces) + elif style == "pep440-post": + rendered = render_pep440_post(pieces) + elif style == "pep440-post-branch": + rendered = render_pep440_post_branch(pieces) + elif style == "pep440-old": + rendered = render_pep440_old(pieces) + elif style == "git-describe": + rendered = render_git_describe(pieces) + elif style == "git-describe-long": + rendered = render_git_describe_long(pieces) + else: + raise ValueError("unknown style '%s'" % style) + + return {"version": rendered, "full-revisionid": pieces["long"], + "dirty": pieces["dirty"], "error": None, + "date": pieces.get("date")} + + +def get_versions() -> Dict[str, Any]: + """Get version information or return default if unable to do so.""" + # I am in _version.py, which lives at ROOT/VERSIONFILE_SOURCE. If we have + # __file__, we can work backwards from there to the root. Some + # py2exe/bbfreeze/non-CPython implementations don't do __file__, in which + # case we can only use expanded keywords. + + cfg = get_config() + verbose = cfg.verbose + + try: + return git_versions_from_keywords(get_keywords(), cfg.tag_prefix, + verbose) + except NotThisMethod: + pass + + try: + root = os.path.realpath(__file__) + # versionfile_source is the relative path from the top of the source + # tree (where the .git directory might live) to this file. Invert + # this to find the root from __file__. + for _ in cfg.versionfile_source.split('/'): + root = os.path.dirname(root) + except NameError: + return {"version": "0+unknown", "full-revisionid": None, + "dirty": None, + "error": "unable to find root of source tree", + "date": None} + + try: + pieces = git_pieces_from_vcs(cfg.tag_prefix, root, verbose) + return render(pieces, cfg.style) + except NotThisMethod: + pass + + try: + if cfg.parentdir_prefix: + return versions_from_parentdir(cfg.parentdir_prefix, root, verbose) + except NotThisMethod: + pass + + return {"version": "0+unknown", "full-revisionid": None, + "dirty": None, + "error": "unable to compute version", "date": None} \ No newline at end of file From d02dde45d586de1a3bbe22d5c58abe172369a465 Mon Sep 17 00:00:00 2001 From: Jo Basevi Date: Tue, 3 Dec 2024 19:14:22 +1100 Subject: [PATCH 04/11] Update README.md --- .gitignore | 3 ++- README.rst | 13 ++++--------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/.gitignore b/.gitignore index 1bb7c96..38ccff1 100644 --- a/.gitignore +++ b/.gitignore @@ -70,4 +70,5 @@ target/ *.res *.bin *_table -*.yaml +# Commenting out so meta.yaml is tracked by git +# *.yaml diff --git a/README.rst b/README.rst index 6750e92..bc14bb2 100644 --- a/README.rst +++ b/README.rst @@ -28,7 +28,7 @@ Install Conda install:: - conda install -c coecms yamanifest + conda install -c access-nri yamanifest Pip install (into a virtual environment):: @@ -44,19 +44,14 @@ Develop Development install:: - git checkout https://github.com/aidanheerdegen/yamanifest + git checkout https://github.com/ACCESS-NRI/yamanifest cd yamanifest - conda env create -f conda/dev-environment.yml + conda env create -f .conda/env_dev.yml source activate yamanifest-dev - pip install -e '.[dev]' - -The `dev-environment.yml` file is for speeding up installs and installing -packages unavailable on pypi, `requirements.txt` is the source of truth for -dependencies. Run tests:: - py.test + python -m pytest -s Build documentation:: From 64e83946c6c2e2fa88e8be28bb6089963da6f9e8 Mon Sep 17 00:00:00 2001 From: Jo Basevi Date: Tue, 3 Dec 2024 19:15:25 +1100 Subject: [PATCH 05/11] Remove circleci, traveis, requirements.txt and setup.cfg --- .circleci/config.yml | 79 -------------------------------------------- .travis.yml | 36 -------------------- requirements.txt | 4 --- setup.cfg | 45 ------------------------- 4 files changed, 164 deletions(-) delete mode 100644 .circleci/config.yml delete mode 100644 .travis.yml delete mode 100644 requirements.txt delete mode 100644 setup.cfg diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 57024b9..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,79 +0,0 @@ -version: 2.0 -jobs: - py27: - working_directory: /circleci - docker: - - image: scottwales/conda-build - environment: - PYTHON_VER: 2.7 - - steps: - - checkout - - - run: | - conda config --add channels coecms - conda build conda --python=${PYTHON_VER} - - - run: | - mkdir /artefacts - cp $(conda build conda --python=${PYTHON_VER} --output) /artefacts - - - persist_to_workspace: - root: /artefacts - paths: '*' - - py37: - working_directory: /circleci - docker: - - image: scottwales/conda-build - environment: - PYTHON_VER: 3.7 - - steps: - - checkout - - - run: | - conda config --add channels coecms - conda build conda --python=${PYTHON_VER} - - - run: | - mkdir /artefacts - cp $(conda build conda --python=${PYTHON_VER} --output) /artefacts - - - persist_to_workspace: - root: /artefacts - paths: '*' - - publish: - working_directory: /circleci - docker: - - image: scottwales/conda-build - steps: - - attach_workspace: - at: /artefacts - - - run: - anaconda --token "${ANACONDA_TOKEN}" upload --user "${ANACONDA_USER}" /artefacts/*.tar.bz2 - -workflows: - version: 2 - build_and_publsh: - jobs: - - py27: - filters: - tags: - only: /.*/ - - - py37: - filters: - tags: - only: /.*/ - - - publish: - requires: - - py37 - filters: - tags: - only: /.*/ - branches: - ignore: /.*/ diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 6a7b5ed..0000000 --- a/.travis.yml +++ /dev/null @@ -1,36 +0,0 @@ -language: python -python: - - '2.7' - - '3.5' -install: - - if [[ "$TRAVIS_PYTHON_VERSION" == "2.7" ]]; then - wget https://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh -O miniconda.sh; - else - wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh; - fi - - bash miniconda.sh -b -p $HOME/miniconda - - export PATH="$HOME/miniconda/bin:$PATH" - - - conda config --set always_yes yes --set changeps1 no - - conda create -n travis python=$TRAVIS_PYTHON_VERSION - - conda env update -n travis -f conda/dev-environment.yml - - if [ -f conda/dev-environment-py${TRAVIS_PYTHON_VERSION}.yml ]; then conda env update -n travis -f conda/dev-environment-py${TRAVIS_PYTHON_VERSION}.yml; fi - - source activate travis - - - pip install --upgrade pytest coverage codecov codeclimate-test-reporter - - pip install . -script: - - coverage run --source yamanifest -m py.test -after_success: - - codecov - - codeclimate-test-reporter - -deploy: - provider: pypi - user: aidanheerdegen - password: - secure: "Q+iWh5IvEBKyeEy5xNghszSMHngpmY6sPJav18d0SGhTiHJCBvWXmbxM+41ILEPr+Gcqb6FmOFJ10reqvz2DbSEwArjjCO+fg7dOsyUYPlF0DZI2FbxUCaoi5VVP4DXNSiIGqeAe2+j4AnIyk2TJH/oe1uJDmkrDsr+ZchbA0OmNMZ04Ma1vt6jGvIxxfgDGKXI3PGvD3lYH7wsEaeTj5R5JHTXO7CcPN0aLy0Lw0OXKLcv4do4lkFDCqSzuJ3aM1xp1Iz3oNoXB6lLC2A5JnlblGqk61zeOY8Z3wpurOMvktL9pvUIURsbhGHoiA9X6e9QVw87tQBb+gN2gWTvVRQpKsV4GvtYpm4vtOhQydv/uJSZ+ZdS1epCDin9tXKMbjWW+VA+CpFyIaHqPYFt8lKoiMCVuFgfHidbh7tbXLCnYcVdBt4ZBKGGNGBwOz0c3aU0SLTgS6ipXQvoG00DXXI/D0jkKfWuVkXSdFrygy2+atuAV9V/hjV6KwS+1JziLvJaC1r9j8S9tBVBPXUyFqglFXUQ+TW/awOyNAxqd7QwpGGsjdcnmZnWyilWPa30Cw/qL/Ao3c2LdoXVFZiNsX1R+m3kMuIFj2vFUZ9IyclHQnBFzHu4q5UcNrQczPTqanL/f/CPnYta0TXBORIjKN+gNsP5Nz3OmqcPOP9iSl3k=" - on: - tags: true - repo: aidanheerdegen/yamanifest - distributions: "sdist" diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 3d12287..0000000 --- a/requirements.txt +++ /dev/null @@ -1,4 +0,0 @@ -# Add general dependencies here -# Optional dependencies e.g. [dev] are added in `setup.cfg` -PyYAML -nchash>=0.1.5 diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index dbd8ec0..0000000 --- a/setup.cfg +++ /dev/null @@ -1,45 +0,0 @@ -[metadata] -name = yamanifest -author = Aidan Heerdegen -author-email = aidan.heerdegen@anu.edu.au -summary = General YAML manifest format -description-file = README.rst -licence = Apache 2.0 -classifier = - Development Status :: 3 - Alpha - Environment :: Console - Intended Audience :: Science/Research - License :: OSI Approved :: Apache Software License - Operating System :: POSIX :: Linux - Programming Language :: Python :: 2.6 - Programming Language :: Python :: 2.7 - Programming Language :: Python :: 3.5 - -[files] -packages = - yamanifest - -[pbr] -autodoc_tree_index_modules = True -autodoc_tree_excludes = - setup.py - conftest.py - test - -[entry_points] -console_scripts = - yamf=yamanifest.yamf:main_argv - -[extras] -# Optional dependencies -dev = - pytest - sphinx - recommonmark - -[build_sphinx] -source-dir = docs -build-dir = docs/_build - -[tool:pytest] -addopts = --doctest-modules --doctest-glob='*.rst' --ignore setup.py --ignore conftest.py --ignore docs/conf.py From 82364cae3a8cfdad255137ab0f8f8c209f14f668 Mon Sep 17 00:00:00 2001 From: Jo Basevi Date: Tue, 3 Dec 2024 19:16:29 +1100 Subject: [PATCH 06/11] workflows/CI: Comment out PY_VERSION temporarily --- .github/workflows/CI.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 31969f4..e0dc410 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -49,7 +49,7 @@ jobs: uses: conda-incubator/setup-miniconda@a4260408e20b96e80095f42ff7f1a15b27dd94ca # v3.0.4 with: miniconda-version: "latest" - python-version: vars.PY_VERSION + python-version: "3.10" # TODO: Add back in vars.PY_VERSION environment-file: .conda/env_build.yml auto-activate-base: false auto-update-conda: false From 4bbf596055c2081923d33b7473217fccefb07815 Mon Sep 17 00:00:00 2001 From: Jo Basevi Date: Tue, 3 Dec 2024 19:34:44 +1100 Subject: [PATCH 07/11] workflows/CI: Fix file filter --- .github/workflows/CI.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index e0dc410..95940b5 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -32,7 +32,7 @@ jobs: filters: | files: - 'pyproject.toml' - - 'setup.cfg' + - 'setup.py' - '.conda/env_build.yml' - '.conda/meta.yml' From 1eb57a15f0f16a104ceee53e99744ef1808fa804 Mon Sep 17 00:00:00 2001 From: Jo Basevi Date: Tue, 3 Dec 2024 19:39:21 +1100 Subject: [PATCH 08/11] workflows/CD: Change label in conda build to main --- .github/workflows/CD.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CD.yml b/.github/workflows/CD.yml index 0865016..1f1591f 100644 --- a/.github/workflows/CD.yml +++ b/.github/workflows/CD.yml @@ -33,5 +33,5 @@ jobs: meta_yaml_dir: .conda python-version: ${{ vars.PY_VERSION }} user: accessnri - label: master + label: main token: ${{ secrets.ANACONDA_TOKEN }} \ No newline at end of file From f208870cf5f2c1c17f4762805d87663bac12d08b Mon Sep 17 00:00:00 2001 From: jo-basevi Date: Tue, 10 Dec 2024 11:32:15 +1100 Subject: [PATCH 09/11] Apply suggestions from code review Add in conda-verify ignore descriptions Co-authored-by: Tommy Gatti --- .github/workflows/CI.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 95940b5..2c5d9b6 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -57,6 +57,9 @@ jobs: - name: Verify conda recipe shell: bash -el {0} + # Ignores: + # C2105 - Found invalid package version in meta.yaml + # C2122 - Found invalid license family run: conda-verify .conda --ignore C2105,C2122 - name: Run conda build @@ -66,6 +69,10 @@ jobs: - name: Verify conda package shell: bash -el {0} + # Ignores: + # C1105 - Found invalid version number in info/index.json + # C1115 - Found invalid license in info/index.json + # C1141 - Found python file without a corresponding pyc file run: conda-verify ./build/noarch/*.tar.bz2 --ignore C1105,C1115,C1141 tests: From d8cae0e6d00bde86f01fd8a2736439250c6faae4 Mon Sep 17 00:00:00 2001 From: Jo Basevi Date: Tue, 10 Dec 2024 11:40:16 +1100 Subject: [PATCH 10/11] workflows/CI: Update workflow with review feedback - Use Github variable for python version in conda build - Remove channels from conda build - Use --exit in conda-verify so the step exits when a check fails --- .github/workflows/CI.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 2c5d9b6..b2cdafc 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -49,7 +49,7 @@ jobs: uses: conda-incubator/setup-miniconda@a4260408e20b96e80095f42ff7f1a15b27dd94ca # v3.0.4 with: miniconda-version: "latest" - python-version: "3.10" # TODO: Add back in vars.PY_VERSION + python-version: ${{ vars.PY_VERSION }} environment-file: .conda/env_build.yml auto-activate-base: false auto-update-conda: false @@ -60,12 +60,12 @@ jobs: # Ignores: # C2105 - Found invalid package version in meta.yaml # C2122 - Found invalid license family - run: conda-verify .conda --ignore C2105,C2122 + run: conda-verify .conda --ignore C2105,C2122 --exit - name: Run conda build shell: bash -el {0} run: | - conda build . --no-anaconda-upload --output-folder=./build -c conda-forge -c accessnri -c coecms + conda build . --no-anaconda-upload --output-folder=./build - name: Verify conda package shell: bash -el {0} @@ -73,7 +73,7 @@ jobs: # C1105 - Found invalid version number in info/index.json # C1115 - Found invalid license in info/index.json # C1141 - Found python file without a corresponding pyc file - run: conda-verify ./build/noarch/*.tar.bz2 --ignore C1105,C1115,C1141 + run: conda-verify ./build/noarch/*.tar.bz2 --ignore C1105,C1115,C1141 --exit tests: name: Tests @@ -116,7 +116,7 @@ jobs: - name: Run tests shell: bash -l {0} run: | - python -m pytest --cov=yamanifest --cov-report=html -s # test + python -m pytest --cov=yamanifest --cov-report=html -s test # - name: Upload code coverage # # Only upload once for the installed version From d7ae55d5db13bd606d05a851d88c5d454ffe81d2 Mon Sep 17 00:00:00 2001 From: Jo Basevi Date: Tue, 10 Dec 2024 13:00:37 +1100 Subject: [PATCH 11/11] Remove pylint from CI --- .conda/env_dev.yml | 1 - .github/workflows/CI.yml | 4 ---- pyproject.toml | 7 ------- 3 files changed, 12 deletions(-) diff --git a/.conda/env_dev.yml b/.conda/env_dev.yml index f9744a9..4a85bdf 100644 --- a/.conda/env_dev.yml +++ b/.conda/env_dev.yml @@ -15,5 +15,4 @@ dependencies: - nchash>=0.1.5 - pytest - pytest-cov - - pylint - versioneer diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index b2cdafc..8ad73b7 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -105,10 +105,6 @@ jobs: shell: bash -l {0} run: conda list - # - name: Lint # TODO: Add back in linting - # shell: bash -l {0} - # run: pylint --extension-pkg-whitelist=netCDF4 --ignored-modules=yamanifest -E yamanifest - - name: Entrypoint test of driver script shell: bash -l {0} run: yamf --help diff --git a/pyproject.toml b/pyproject.toml index 6347692..e7b6e44 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -17,13 +17,6 @@ dependencies = [ "six" ] -# [project.optional-dependencies] -# test = [ -# "pytest", -# "pylint", -# "Sphinx" -# ] - [project.scripts] yamf = "yamanifest.yamf:main_argv"