Skip to content

Commit 9963f11

Browse files
authored
Clean build dist scripts and not used files (#427)
1 parent cb91bfc commit 9963f11

File tree

5 files changed

+19
-73
lines changed

5 files changed

+19
-73
lines changed

MANIFEST.in

Lines changed: 9 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,9 @@
1-
include LICENSE.txt
2-
include THIRD_PARTY_LICENSES.txt
3-
include ads/common/*.json
4-
include ads/feature_engineering/*.json
5-
include ads/templates/*.jinja2
6-
include ads/common/function/*.yaml
7-
include ads/common/artifact/*.*
8-
include ads/model/runtime/schemas/*.yaml
9-
include ads/jobs/schema/**
10-
include ads/opctl/index.yaml
11-
include ads/opctl/operators/**/*.py
12-
include ads/opctl/docker/**
13-
include ads/opctl/conda/manifest_template.yaml
14-
include ads/opctl/conda/config.yaml
15-
include ads/opctl/config/diagnostics/**/*.yaml
16-
include ads/opctl/templates/*.jinja2
17-
include pyproject.toml
18-
global-exclude tests/**
19-
global-exclude notebooks/**
20-
exclude tests/**
21-
exclude notebooks/**
22-
exclude build/lib/tests/**
23-
exclude build/lib/notebooks/**
24-
exclude benchmark/**
25-
include ads/ads
26-
include ads/model/common/*.*
27-
include ads/operator/**/*.md
28-
include ads/operator/**/*.yaml
29-
include ads/operator/**/*.whl
30-
include ads/operator/**/MLoperator
1+
# Manifest.in file used by setuptools, which we are not using anymore.
2+
# Do not add anything to this file, unless revert back to setuptools, which is not recommended. See why here:
3+
# https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html.
4+
5+
# Instead flit-core used as backend to build ADS - see section [build-system] in pyproject.toml.
6+
# For flit-core we can specify files and folders, which needs to be included or excluded in build using
7+
# [tool.flit.sdist] section of pyproject.toml. See: https://flit.pypa.io/en/latest/pyproject_toml.html#sdist-section
8+
# If build-system library will change, make changed to list of included/excluded to build files accordingly
9+
# as it will be suggested by new build-system library.

Makefile

Lines changed: 1 addition & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,3 @@
1-
RELEASE_BRANCH := release/ads
2-
DOCS_RELEASE_BRANCH := release
3-
CLONE_DIR := /tmp/advanced-ds
4-
DOCS_CLONE_DIR := /tmp/ads-docs
5-
COPY_INVENTORY := CONTRIBUTING.md LICENSE.txt MANIFEST.in README-development.md README.md SECURITY.md THIRD_PARTY_LICENSES.txt
6-
7-
prepare-release-branch: clean
8-
@git checkout master
9-
@git clean -xdf
10-
@git pull
11-
git checkout -b release/$(RELEASE_VERSION)
12-
13-
prepare-ads:
14-
@echo "Started advanced-ds clone at $$(date)"
15-
@git clone ssh://git@bitbucket.oci.oraclecorp.com:7999/odsc/advanced-ds.git --branch $(RELEASE_BRANCH) --depth 1 $(CLONE_DIR)
16-
@echo "Finished cloning at $$(date)"
17-
cp -r $(CLONE_DIR)/ads .
18-
$(foreach var,$(COPY_INVENTORY),cp $(CLONE_DIR)/$(var) .;)
19-
20-
prepare-docs:
21-
@echo "Started ads_docs clone at $$(date)"
22-
@git clone ssh://git@bitbucket.oci.oraclecorp.com:7999/odsc/ads_docs.git --branch $(DOCS_RELEASE_BRANCH) --depth 1 $(DOCS_CLONE_DIR)
23-
@echo "Finished cloning at $$(date)"
24-
cp -r $(DOCS_CLONE_DIR)/source docs/ && cp $(DOCS_CLONE_DIR)/requirements.txt docs
25-
26-
prepare: prepare-release-branch prepare-ads prepare-docs
27-
28-
push: clean
29-
@bash -c 'if [[ $$(git branch | grep \*) == "* release/$(RELEASE_VERSION)" ]];then echo "Version matching current branch"; else echo "Set proper value to RELEASE_VERSION";exit 1 ; fi'
30-
@git add .
31-
@git commit -m "Release version: $(RELEASE_VERSION)"
32-
@git push --set-upstream origin release/$(RELEASE_VERSION)
33-
341
dist: clean
352
@python3 -m build
363

@@ -43,5 +10,4 @@ clean:
4310
@find ./ -name '*.pyc' -exec rm -f {} \;
4411
@find ./ -name 'Thumbs.db' -exec rm -f {} \;
4512
@find ./ -name '*~' -exec rm -f {} \;
46-
@rm -rf $(CLONE_DIR)
47-
@rm -rf $(DOCS_CLONE_DIR)
13+
@find ./ -name '.DS_Store' -exec rm -f {} \;

ads/secrets/secrets.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -324,9 +324,7 @@ def __enter__(self, *args, **kwargs):
324324
)
325325
os.environ.update(export_dict)
326326
self.exported_keys = list(export_dict.keys())
327-
logger.debug(
328-
f"Exporting credentials to environment. Keys: {self.exported_keys}"
329-
)
327+
logger.debug(f"Exporting credentials to environment.")
330328
else:
331329
logger.debug(f"Skipping Export credentials to environment.")
332330

pyproject.toml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
## Check README-development.md and Makefile for instruction how to install or build ADS locally.
55

66
[build-system]
7-
# These are the assumed default build requirements from pip:
8-
# https://pip.pypa.io/en/stable/reference/pip/#pep-517-and-518-support
97
# PEP 517 – A build-system independent format for source trees - https://peps.python.org/pep-0517/
10-
requires = ["flit-core >= 3.8"]
8+
# Till recently flit-core library was suggested by pip, so we used it. In future, cosider to change to
9+
# other, if better, build-backend library.
10+
requires = ["flit-core >=3.8,<4"] # should specify <4, so won’t be impacted by changes in the next major version
1111
build-backend = "flit_core.buildapi"
1212

1313

@@ -203,3 +203,8 @@ ads = "ads.cli:cli"
203203

204204
[tool.flit.module]
205205
name = "ads" # name for local build and import, see https://flit.pypa.io/en/latest/pyproject_toml.html#module-section
206+
207+
[tool.flit.sdist]
208+
# By default `ads` folder and `LICENSE.txt` file included in sdist. Folders `docs` and `tests` are excluded, as weel as other project files
209+
# Use this section to include/exclude files and folders. See doc: https://flit.pypa.io/en/latest/pyproject_toml.html#sdist-section
210+
include = ["THIRD_PARTY_LICENSES.txt"]

setup.cfg

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)