Skip to content

Conversation

@ndgrigorian
Copy link
Collaborator

@ndgrigorian ndgrigorian commented Oct 15, 2025

A warning that python setup.py develop is deprecated and will no longer be supported at the end of October, 2025 has been ongoing for some time when using dpctl build driver script, and can be seen in the CI

This PR proposes instead relying on pip for installing dpctl in the script, and reworks the script to maintain use of scikit-build

In the future, this will also simplify a transition to scikit-build-core

The PR also introduces options

  • --clean and --skip-editable to build_locally driver
  • --clean and --skip-pytest to gen_coverage driver
  • --clean to gen_docs driver
  • Have you provided a meaningful PR description?
  • Have you added a test, reproducer or referred to an issue with a reproducer?
  • Have you tested your changes locally for CPU and GPU devices?
  • Have you made sure that new changes do not introduce compiler warnings?
  • Have you checked performance impact of proposed changes?
  • Have you added documentation for your changes, if necessary?
  • Have you added your changes to the changelog?
  • If this PR is a work in progress, are you opening the PR as a draft?

@ndgrigorian ndgrigorian force-pushed the do-not-use-setup-py-develop branch from 6d87c72 to 124f5f7 Compare October 15, 2025 00:34
@github-actions
Copy link

@github-actions
Copy link

Array API standard conformance tests for dpctl=0.21.0=py310h93fe807_29 ran successfully.
Passed: 1115
Failed: 6
Skipped: 119

@github-actions
Copy link

Array API standard conformance tests for dpctl=0.21.0=py310h93fe807_29 ran successfully.
Passed: 1116
Failed: 5
Skipped: 119

@coveralls
Copy link
Collaborator

coveralls commented Oct 15, 2025

Coverage Status

coverage: 86.277%. remained the same
when pulling 5b395e7 on do-not-use-setup-py-develop
into 091beaa on master.

@ndgrigorian ndgrigorian force-pushed the do-not-use-setup-py-develop branch 2 times, most recently from fd45fec to 13409b7 Compare October 15, 2025 05:18
@github-actions
Copy link

Array API standard conformance tests for dpctl=0.21.0=py310h93fe807_30 ran successfully.
Passed: 1114
Failed: 7
Skipped: 119

to be reused in gen_docs and gen_coverage
@ndgrigorian ndgrigorian force-pushed the do-not-use-setup-py-develop branch from 13409b7 to 32f1509 Compare October 15, 2025 05:42
@github-actions
Copy link

Array API standard conformance tests for dpctl=0.21.0=py310h93fe807_30 ran successfully.
Passed: 1115
Failed: 6
Skipped: 119

1 similar comment
@github-actions
Copy link

Array API standard conformance tests for dpctl=0.21.0=py310h93fe807_30 ran successfully.
Passed: 1115
Failed: 6
Skipped: 119

@ndgrigorian ndgrigorian changed the title Do not use python setup.py develop in the project Remove use of python setup.py develop/install in the project Oct 15, 2025
p.add_argument(
"--debug",
default="Release",
dest="build_type",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The debug build produces a lot of the warning which probably has to be resolved in the follow-up PR.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a number of them are
icpx: warning: argument unused during compilation: '-Xsycl-target-frontend=spir64 -g0'
which will need some looking at

the remainder are
warning: comparison of integers of different signs: 'py::ssize_t' (aka 'long') and 'std::size_t'
from
assert(dst.get_size() == iter_nelems)
in sorting functions

should be a simple enough fix

@ndgrigorian ndgrigorian force-pushed the do-not-use-setup-py-develop branch from 00161f1 to 989df1b Compare October 15, 2025 15:40
@github-actions
Copy link

Array API standard conformance tests for dpctl=0.21.0=py310h93fe807_32 ran successfully.
Passed: 1116
Failed: 5
Skipped: 119

@github-actions
Copy link

Array API standard conformance tests for dpctl=0.21.0=py310h93fe807_31 ran successfully.
Passed: 1115
Failed: 6
Skipped: 119

@github-actions
Copy link

Array API standard conformance tests for dpctl=0.21.0=py310h93fe807_32 ran successfully.
Passed: 1115
Failed: 6
Skipped: 119

@ndgrigorian ndgrigorian force-pushed the do-not-use-setup-py-develop branch from acb4584 to a113d01 Compare October 28, 2025 23:03
@github-actions
Copy link

Array API standard conformance tests for dpctl=0.22.0dev0=py310h93fe807_33 ran successfully.
Passed: 1115
Failed: 6
Skipped: 119

@github-actions
Copy link

Array API standard conformance tests for dpctl=0.22.0dev0=py310h93fe807_34 ran successfully.
Passed: 1115
Failed: 6
Skipped: 119

1 similar comment
@github-actions
Copy link

Array API standard conformance tests for dpctl=0.22.0dev0=py310h93fe807_34 ran successfully.
Passed: 1115
Failed: 6
Skipped: 119

@ndgrigorian ndgrigorian marked this pull request as ready for review October 28, 2025 23:54
@github-actions
Copy link

Array API standard conformance tests for dpctl=0.22.0dev0=py310h93fe807_35 ran successfully.
Passed: 1115
Failed: 6
Skipped: 119

pushd $d
conda activate --stack ${{ env.BUILD_ENV_NAME }}
CC=icx CXX=icpx python setup.py develop -G Ninja || exit 1
CC=icx CXX=icpx python setup.py build_ext --inplace -G Ninja || exit 1
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CONTRIBUTING.md needs to be updated also

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and docs/_legacy/docfiles/user_guides/QuickStart.rst and docs/doc_sources/contributor_guides/building.rst

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some README.md in the examples folder as well

import sys

# add scripts dir to Python path so we can import _build_helper
sys.path.insert(0, os.path.abspath("scripts"))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder for what use case we need that? Simple python scripts/build_locally.py works fine without that.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It didn't work for me locally without this, essentially importing from _build_helper wouldn't work without this or an __init__.py

"--bin-llvm",
help="Path to folder where llvm-cov/llvm-profdata can be found",
)
p.add_argument("--skip-pytest", dest="run_pytest", action="store_false")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing description of the argument

Comment on lines +159 to +167
env = os.environ.copy()

if "CMAKE_ARGS" in env and env["CMAKE_ARGS"].strip():
warn("Ignoring pre-existing CMAKE_ARGS in environment", "gen_docs")
del env["CMAKE_ARGS"]

env["CMAKE_ARGS"] = cmake_args

print(f"[gen_docs] Using CMake args:\n {env['CMAKE_ARGS']}")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to move that to a helper function, looks quite the same use across the files?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I plan to remove this, I was mistakenly under the impression that we needed to pass via CMAKE_ARGS when using python setup.py build_ext --inplace, but I can get it working without it

)

# Level Zero state (on unless explicitly disabled)
if args.no_level_zero:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder, if --no-level-zero is deprecated, should we base the logic mostly on --target-level-zero option then?
Should we consider level_zero_enabled = False if --target-level-zero is not passed?

dest="no_level_zero",
action="store_true",
default=False,
help="Disable Level Zero backend (deprecated: use --target-level-zero "
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--target-level-zero OFF does not work

Comment on lines +152 to +162
if args.no_level_zero and args.target_level_zero:
err(
"Cannot combine --no-level-zero and --target-level-zero",
"build_locally",
)

# Level Zero state (on unless explicitly disabled)
if args.no_level_zero:
level_zero_enabled = False
elif args.target_level_zero:
level_zero_enabled = True
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the same in all three scripts and can be moved to the helper as a function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants