Skip to content
This repository has been archived by the owner on Oct 11, 2022. It is now read-only.

Commit

Permalink
Release beta 36
Browse files Browse the repository at this point in the history
  • Loading branch information
achave11-ucsc committed Mar 18, 2022
2 parents 4e8601b + 407a9a3 commit e3808eb
Show file tree
Hide file tree
Showing 6 changed files with 136 additions and 7 deletions.
69 changes: 69 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: CI

on:
pull_request:
push:
branches:
- develop
- main

env:
python_version: 3.6
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

jobs:
test:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ env.python_version }}
- uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('setup.py', 'Makefile') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Test
run: |
python3.6 -m venv .venv
source .venv/bin/activate
make travis_install
# Hack: The use of `chrgp` compensates for a quirk of Docker. The PyCharm image
# used by `make format` sets up a user called `developer` and assigns it UID
# 1000. GitHub Actions runs as UID 121. An alternative would be to pass --user
# to `docker run` and bind-mount an /etc/passwd that maps that to `developer`.
# Currently, we're unclear why `make format` works as is on developer machines.
chmod -R g+w . && sudo chgrp -R 1000 . && make format && sudo chgrp -R $(id -g) .
make check_clean
make pep8
make test
- uses: actions/upload-artifact@v2
with:
name: coverage-file
path: .coverage

coveralls:
needs: test
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ env.python_version }}
- name: Download coverage file
uses: actions/download-artifact@v2
with:
name: coverage-file
- name: Coveralls
run: |
pip install coveralls==3.0.1
# This API token is associated with the repository, not any particular user. A
# GitHub user with admin privileges must retrieve the token from
# https://coveralls.io/github/DataBiosphere/hca-metadata-api and deposit it in
# https://github.com/DataBiosphere/hca-metadata-api/settings/secrets/actions
# as a secret called `COVERALLS_REPO_TOKEN`.
COVERALLS_REPO_TOKEN=${{ secrets.COVERALLS_REPO_TOKEN }} coveralls
51 changes: 51 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,54 @@ area repository.

Copy the token and use it as the value of an environment variable named
`GITHUB_TOKEN`.

## Release guide

This guide will walk you through the steps necessary to promote the `develop`
branch to `main`, tag the release, and prepare `develop` for the next release.

Note: For purpose of example, this guide will pretend we are upgrading `main`
from release 29 to 30.

1. Merge `develop` into `main`.

- Resolve conflicts in `setup.py`, promote to the higher version.

```
< version="1.0b29", # value from `main`
< version="1.0b30.dev1", # value from `develop`
> version="1.0b30", # new value for `main`
```
- Title the merge commit: "Release beta 30".
- Push `main` to GitHub.
2. Create a new release.
- On the GitHub repository home page click *Releases* — *Draft a new release*
- Tag: (create new) `release/1.0b30`
- Target: `main`
- Title: `Release 1.0 beta 30`
- description: (list all tickets & PRs included since the previous release)
- This is a pre-release: (leave unchecked)
- Click *Publish release*.
3. Prepare `develop` for the next release.
- Add a commit to increment the version in `setup.py` .
```
< version="1.0b30.dev1",
> version="1.0b31.dev1",
```
- Title the commit "Prepare beta 31".
- Push `develop` to GitHub.
File renamed without changes.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup(
name="hca-metadata-api",
version="1.0b35",
version="1.0b36",
license='MIT',
install_requires=[
"dataclasses >= 0.6;python_version<'3.7'"
Expand Down
17 changes: 13 additions & 4 deletions src/humancellatlas/data/metadata/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -657,11 +657,11 @@ def is_sequencing_process(self):


@dataclass(frozen=True)
class ImagingTarget:
class ImagingProbe:
assay_type: str

@classmethod
def from_json(cls, json: JSON) -> 'ImagingTarget':
def from_json(cls, json: JSON) -> 'ImagingProbe':
assay_type = ontology_label(json['assay_type'])
return cls(assay_type=assay_type)

Expand Down Expand Up @@ -762,15 +762,24 @@ class IpscInductionProtocol(Protocol):

@dataclass(init=False)
class ImagingProtocol(Protocol):
target: List[ImagingTarget] # A list so all the ImagingTarget objects can be tallied when indexed
probe: List[ImagingProbe] # A list so all the ImagingProbe objects can be tallied when indexed

def __init__(self,
json: JSON,
metadata_manifest_entry: Optional[ManifestEntry]
) -> None:
super().__init__(json, metadata_manifest_entry)
content = json.get('content', json)
self.target = [ImagingTarget.from_json(target) for target in content['target']]
self.probe = [
ImagingProbe.from_json(probe)
for probe in lookup(content, 'probe', 'target', default=[])
]

@property
def target(self) -> List[ImagingProbe]:
warnings.warn('ImagingProtocol.target is deprecated. '
'Use ImagingProtocol.probe instead.', DeprecationWarning)
return self.probe


@dataclass(init=False)
Expand Down
4 changes: 2 additions & 2 deletions test/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -560,8 +560,8 @@ def test_imaging_protocol(self):
manifest, metadata_files = self._canned_bundle('staging', uuid, version)
bundle = Bundle(uuid, version, manifest, metadata_files)
imaging_protocol = one([p for p in bundle.protocols.values() if isinstance(p, ImagingProtocol)])
self.assertEqual(len(imaging_protocol.target), 240)
assay_types = {target.assay_type for target in imaging_protocol.target}
self.assertEqual(len(imaging_protocol.probe), 240)
assay_types = {probe.assay_type for probe in imaging_protocol.probe}
self.assertEqual(assay_types, {'in situ sequencing'})

def test_cell_line(self):
Expand Down

0 comments on commit e3808eb

Please sign in to comment.