generated from w3c-ccg/markdown-to-spec
-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pip install #77
Closed
Closed
Pip install #77
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
name: PyPI | ||
on: push | ||
|
||
jobs: | ||
build-n-publish: | ||
name: Build and publish Python distribution to PyPI | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v2 | ||
- name: Build a binary wheel and a source tarball | ||
run: | | ||
python -mpip install wheel | ||
python setup.py sdist bdist_wheel | ||
- name: Publish distribution to PyPI | ||
if: startsWith(github.ref, 'refs/tags') | ||
uses: pypa/[email protected] | ||
with: | ||
password: ${{ secrets.PYPI_PASSWORD }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
*/.DS_Store | ||
**/__pycache__/* | ||
.DS_Store | ||
**/__pycache__/* | ||
dist/ | ||
*.egg-info/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
recursive-exclude examples * | ||
global-include image.schema |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import json | ||
import os | ||
from typing import Dict | ||
|
||
from jsonschema import RefResolver | ||
|
||
SCHEMAS_PATH = "schemas" | ||
|
||
|
||
class LocalRefResolver(RefResolver): | ||
def resolve_remote(self, url: str) -> Dict: | ||
# Use remote URL to generate local path | ||
# e.g. https://ngff.openmicroscopy.org/0.3/schemas/image.schema | ||
rel_path = url.replace("https://ngff.openmicroscopy.org/", "") | ||
curr_dir = os.path.dirname(__file__) | ||
path = os.path.join(curr_dir, "..", rel_path) | ||
path = os.path.normpath(path) | ||
# Load local document and cache it | ||
document = load_json(path) | ||
self.store[url] = document | ||
return document | ||
|
||
|
||
def load_json(path: str) -> Dict: | ||
with open(path) as f: | ||
document = json.loads(f.read()) | ||
return document | ||
|
||
|
||
def get_schema(version: str, strict: bool = False) -> Dict: | ||
schema_name = "strict_image.schema" if strict else "image.schema" | ||
curr_dir = os.path.dirname(__file__) | ||
# The paths here match the paths in the ngff repo (and public schemas) | ||
path = os.path.join( | ||
curr_dir, "..", version, "schemas", schema_name | ||
) | ||
path = os.path.normpath(path) | ||
return load_json(path) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#!/usr/bin/env python | ||
|
||
import codecs | ||
import os | ||
from typing import List | ||
|
||
from setuptools import setup | ||
|
||
|
||
def read(fname): | ||
file_path = os.path.join(os.path.dirname(__file__), fname) | ||
return codecs.open(file_path, encoding="utf-8").read() | ||
|
||
|
||
install_requires: List[List[str]] = [] | ||
install_requires += (["jsonschema"],) | ||
|
||
|
||
setup( | ||
name="ome-ngff", | ||
version="0.0.4dev", | ||
author="The Open Microscopy Team", | ||
url="https://github.com/ome/ngff", | ||
description="OME Next-Generation File Format: spec and schemas", | ||
long_description=read("README.md"), | ||
long_description_content_type="text/markdown", | ||
packages=["ome_ngff"], | ||
py_modules=["ome_ngff"], | ||
# include_package_data = True, | ||
python_requires=">=3.6", | ||
install_requires=install_requires, | ||
classifiers=[ | ||
"Development Status :: 4 - Beta", | ||
"Intended Audience :: Developers", | ||
"Intended Audience :: Science/Research", | ||
"Topic :: Software Development :: Libraries :: Python Modules", | ||
"Programming Language :: Python", | ||
"Programming Language :: Python :: 3", | ||
"Operating System :: OS Independent", | ||
"License :: OSI Approved :: BSD License", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Another issue to clarify is that the repository is currently marked under the W3C Sofware and Document License - see https://github.com/ome/ngff/blob/main/LICENSE.md |
||
], | ||
tests_require=["pytest"], | ||
) |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This
version
probably expresses best my concerns about the multi-type repository. Turning it into a question, what is our positions on the different versions in this repository? I see at least 3 sources of truth:"Are these versions expected to be in sync or evolve independently. For all the versions that are in sync, can we use a single-source of truth.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The "version of the latest schema" is defined by the most recent top-level directory, currently
/0.3/
but I think that doesn't have to match the current version in setup.py, since the directory will never be named*dev
. But at each release they should match and correspond to the repo tag (with bumpversion being the single source of truth).