diff --git a/CHANGELOG.md b/CHANGELOG.md index dd226c3..b8623b2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,10 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] -- n/a +### Fixed + +- Fixed missing files from source distribution ## 0.1.0 - 2020-03-24 -Initial release. +- Initial release [Unreleased]: https://github.com/release-engineering/cdn-definitions/compare/v0.1.0...HEAD diff --git a/MANIFEST.in b/MANIFEST.in index 38d2e4f..2330fab 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,5 +1,4 @@ include README.md include CHANGELOG.md include LICENSE -include cdn_definitions/*.json -include cdn_definitions/*.yaml +graft src diff --git a/docs/conf.py b/docs/conf.py index d201307..31f0ecb 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -103,7 +103,7 @@ html_static_path = ["_static"] # Copy cdn_definitions path here to include online versions of the data. -html_extra_path = ["../cdn_definitions"] +html_extra_path = ["../src/cdn_definitions"] # Custom sidebar templates, must be a dictionary that maps document names # to template names. diff --git a/docs/data.rst b/docs/data.rst index 87949bd..2a60702 100644 --- a/docs/data.rst +++ b/docs/data.rst @@ -12,7 +12,7 @@ It is also available in raw JSON or YAML format at URLs: - https://release-engineering.github.io/cdn-definitions/data.yaml -.. include:: ../cdn_definitions/data.yaml +.. include:: ../src/cdn_definitions/data.yaml :code: yaml @@ -27,5 +27,5 @@ It is also available in raw JSON or YAML format at URLs: - https://release-engineering.github.io/cdn-definitions/schema.json - https://release-engineering.github.io/cdn-definitions/schema.yaml -.. include:: ../cdn_definitions/schema.yaml +.. include:: ../src/cdn_definitions/schema.yaml :code: yaml diff --git a/scripts/make-json b/scripts/make-json index d515a5e..b69b28f 100755 --- a/scripts/make-json +++ b/scripts/make-json @@ -8,8 +8,8 @@ ROOT = os.path.dirname(os.path.dirname(__file__)) def sync_dataset(basename): - yaml_file = os.path.join(ROOT, "cdn_definitions", "%s.yaml" % basename) - json_file = os.path.join(ROOT, "cdn_definitions", "%s.json" % basename) + yaml_file = os.path.join(ROOT, "src", "cdn_definitions", "%s.yaml" % basename) + json_file = os.path.join(ROOT, "src", "cdn_definitions", "%s.json" % basename) with open(yaml_file) as f: data_yaml = yaml.load(f, yaml.SafeLoader) diff --git a/setup.py b/setup.py index 2800bdd..ffe6617 100644 --- a/setup.py +++ b/setup.py @@ -1,4 +1,4 @@ -from setuptools import setup +from setuptools import setup, find_packages def get_description(): @@ -19,7 +19,8 @@ def get_long_description(): version="0.1.0", author="Rohan McGovern", author_email="rmcgover@redhat.com", - packages=["cdn_definitions"], + packages=find_packages("src"), + package_dir={"": "src"}, url="https://github.com/release-engineering/cdn-definitions", license="GNU General Public License", description=get_description(), diff --git a/cdn_definitions/__init__.py b/src/cdn_definitions/__init__.py similarity index 100% rename from cdn_definitions/__init__.py rename to src/cdn_definitions/__init__.py diff --git a/cdn_definitions/_impl/__init__.py b/src/cdn_definitions/_impl/__init__.py similarity index 100% rename from cdn_definitions/_impl/__init__.py rename to src/cdn_definitions/_impl/__init__.py diff --git a/cdn_definitions/data.json b/src/cdn_definitions/data.json similarity index 100% rename from cdn_definitions/data.json rename to src/cdn_definitions/data.json diff --git a/cdn_definitions/data.yaml b/src/cdn_definitions/data.yaml similarity index 100% rename from cdn_definitions/data.yaml rename to src/cdn_definitions/data.yaml diff --git a/cdn_definitions/schema.json b/src/cdn_definitions/schema.json similarity index 100% rename from cdn_definitions/schema.json rename to src/cdn_definitions/schema.json diff --git a/cdn_definitions/schema.yaml b/src/cdn_definitions/schema.yaml similarity index 100% rename from cdn_definitions/schema.yaml rename to src/cdn_definitions/schema.yaml diff --git a/tests/test_schema.py b/tests/test_schema.py index 501ac8b..cbab686 100644 --- a/tests/test_schema.py +++ b/tests/test_schema.py @@ -8,8 +8,8 @@ from . import ROOT_PATH -DATA_PATH = os.path.join(ROOT_PATH, "cdn_definitions", "data.yaml") -SCHEMA_PATH = os.path.join(ROOT_PATH, "cdn_definitions", "schema.yaml") +DATA_PATH = os.path.join(ROOT_PATH, "src", "cdn_definitions", "data.yaml") +SCHEMA_PATH = os.path.join(ROOT_PATH, "src", "cdn_definitions", "schema.yaml") @pytest.fixture diff --git a/tests/test_sync.py b/tests/test_sync.py index 445857c..0c7c50f 100644 --- a/tests/test_sync.py +++ b/tests/test_sync.py @@ -14,8 +14,12 @@ def any_basename(request): def test_data_sync(any_basename): """Verify that .json files are up-to-date with .yaml files.""" - yaml_path = os.path.join(ROOT_PATH, "cdn_definitions", "%s.yaml" % any_basename) - json_path = os.path.join(ROOT_PATH, "cdn_definitions", "%s.json" % any_basename) + yaml_path = os.path.join( + ROOT_PATH, "src", "cdn_definitions", "%s.yaml" % any_basename + ) + json_path = os.path.join( + ROOT_PATH, "src", "cdn_definitions", "%s.json" % any_basename + ) with open(yaml_path) as f: yaml_data = yaml.load(f, yaml.SafeLoader)