Skip to content

Commit 164f66f

Browse files
authored
Merge branch 'main' into migration
2 parents 4f75bba + fefea59 commit 164f66f

15 files changed

Lines changed: 570 additions & 159 deletions

File tree

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ the contribution guidelines: https://github.com/openml/openml-python/blob/main/C
55
Please make sure that:
66
77
* the title of the pull request is descriptive
8-
* this pull requests is against the `develop` branch
8+
* this pull requests is against the `main` branch
99
* for any new functionality, consider adding a relevant example
1010
* add unit tests for new functionalities
1111
* collect files uploaded to test server using _mark_entity_for_removal()

.github/workflows/test.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,8 @@ jobs:
106106

107107
- name: Run tests on Ubuntu Test
108108
if: matrix.os == 'ubuntu-latest'
109+
env:
110+
OPENML_TEST_SERVER_ADMIN_KEY: ${{ secrets.OPENML_TEST_SERVER_ADMIN_KEY }}
109111
run: |
110112
if [ "${{ matrix.code-cov }}" = "true" ]; then
111113
codecov="--cov=openml --long --cov-report=xml"
@@ -121,6 +123,8 @@ jobs:
121123
122124
- name: Run tests on Ubuntu Production
123125
if: matrix.os == 'ubuntu-latest'
126+
env:
127+
OPENML_TEST_SERVER_ADMIN_KEY: ${{ secrets.OPENML_TEST_SERVER_ADMIN_KEY }}
124128
run: |
125129
if [ "${{ matrix.code-cov }}" = "true" ]; then
126130
codecov="--cov=openml --long --cov-report=xml"
@@ -136,6 +140,8 @@ jobs:
136140
137141
- name: Run tests on Windows
138142
if: matrix.os == 'windows-latest'
143+
env:
144+
OPENML_TEST_SERVER_ADMIN_KEY: ${{ secrets.OPENML_TEST_SERVER_ADMIN_KEY }}
139145
run: | # we need a separate step because of the bash-specific if-statement in the previous one.
140146
pytest -n 4 --durations=20 --dist load -sv --reruns 5 --reruns-delay 1 -m "not uses_test_server"
141147

CONTRIBUTING.md

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ To contribute to the openml-python package, follow these steps:
4444

4545
0. Determine how you want to contribute (see above).
4646
1. Set up your local development environment.
47-
1. Fork and clone the `openml-python` repository. Then, create a new branch from the ``develop`` branch. If you are new to `git`, see our [detailed documentation](#basic-git-workflow), or rely on your favorite IDE.
47+
1. Fork and clone the `openml-python` repository. Then, create a new branch from the ``main`` branch. If you are new to `git`, see our [detailed documentation](#basic-git-workflow), or rely on your favorite IDE.
4848
2. [Install the local dependencies](#install-local-dependencies) to run the tests for your contribution.
4949
3. [Test your installation](#testing-your-installation) to ensure everything is set up correctly.
5050
4. Implement your contribution. If contributing to the documentation, see [here](#contributing-to-the-documentation).
@@ -91,14 +91,25 @@ pytest tests/test_datasets/test_dataset.py::OpenMLDatasetTest
9191
pytest tests/test_datasets/test_dataset.py::OpenMLDatasetTest::test_get_data
9292
```
9393

94-
To test your new contribution, add [unit tests](https://github.com/openml/openml-python/tree/develop/tests), and, if needed, [examples](https://github.com/openml/openml-python/tree/develop/examples) for any new functionality being introduced. Some notes on unit tests and examples:
94+
To test your new contribution, add [unit tests](https://github.com/openml/openml-python/tree/main/tests), and, if needed, [examples](https://github.com/openml/openml-python/tree/main/examples) for any new functionality being introduced. Some notes on unit tests and examples:
9595
* If a unit test contains an upload to the test server, please ensure that it is followed by a file collection for deletion, to prevent the test server from bulking up. For example, `TestBase._mark_entity_for_removal('data', dataset.dataset_id)`, `TestBase._mark_entity_for_removal('flow', (flow.flow_id, flow.name))`.
9696
* Please ensure that the example is run on the test server by beginning with the call to `openml.config.start_using_configuration_for_example()`, which is done by default for tests derived from `TestBase`.
9797
* Add the `@pytest.mark.sklearn` marker to your unit tests if they have a dependency on scikit-learn.
9898
99+
#### Running Tests That Require Admin Privileges
100+
101+
Some tests require admin privileges on the test server and will be automatically skipped unless you provide an admin API key. For regular contributors, the tests will skip gracefully. For core contributors who need to run these tests locally, you can set up the key by exporting the variable as below before running the tests:
102+
103+
```bash
104+
# For windows
105+
$env:OPENML_TEST_SERVER_ADMIN_KEY = "admin-key"
106+
# For linux/mac
107+
export OPENML_TEST_SERVER_ADMIN_KEY="admin-key"
108+
```
109+
99110
### Pull Request Checklist
100111
101-
You can go to the `openml-python` GitHub repository to create the pull request by [comparing the branch](https://github.com/openml/openml-python/compare) from your fork with the `develop` branch of the `openml-python` repository. When creating a pull request, make sure to follow the comments and structured provided by the template on GitHub.
112+
You can go to the `openml-python` GitHub repository to create the pull request by [comparing the branch](https://github.com/openml/openml-python/compare) from your fork with the `main` branch of the `openml-python` repository. When creating a pull request, make sure to follow the comments and structured provided by the template on GitHub.
102113
103114
**An incomplete contribution** -- where you expect to do more work before
104115
receiving a full review -- should be submitted as a `draft`. These may be useful
@@ -116,7 +127,7 @@ in the PR description.
116127
117128
The preferred workflow for contributing to openml-python is to
118129
fork the [main repository](https://github.com/openml/openml-python) on
119-
GitHub, clone, check out the branch `develop`, and develop on a new branch
130+
GitHub, clone, check out the branch `main`, and develop on a new branch
120131
branch. Steps:
121132
122133
0. Make sure you have git installed, and a GitHub account.
@@ -137,7 +148,7 @@ local disk:
137148
3. Switch to the ``develop`` branch:
138149
139150
```bash
140-
git checkout develop
151+
git checkout main
141152
```
142153
143154
3. Create a ``feature`` branch to hold your development changes:
@@ -146,7 +157,7 @@ local disk:
146157
git checkout -b feature/my-feature
147158
```
148159
149-
Always use a ``feature`` branch. It's good practice to never work on the ``main`` or ``develop`` branch!
160+
Always use a ``feature`` branch. It's good practice to never work on the ``main`` branch!
150161
To make the nature of your pull request easily visible, please prepend the name of the branch with the type of changes you want to merge, such as ``feature`` if it contains a new feature, ``fix`` for a bugfix, ``doc`` for documentation and ``maint`` for other maintenance on the package.
151162
152163
4. Develop the feature on your feature branch. Add changed files using ``git add`` and then ``git commit`` files:

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
[![License](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)
2121
<!-- Add green badges for CI and precommit -->
2222

23-
[Installation](https://openml.github.io/openml-python/main/#how-to-get-openml-for-python) | [Documentation](https://openml.github.io/openml-python) | [Contribution guidelines](https://github.com/openml/openml-python/blob/develop/CONTRIBUTING.md)
23+
[Installation](https://openml.github.io/openml-python/main/#how-to-get-openml-for-python) | [Documentation](https://openml.github.io/openml-python) | [Contribution guidelines](https://github.com/openml/openml-python/blob/main/CONTRIBUTING.md)
2424
</div>
2525

2626
OpenML-Python provides an easy-to-use and straightforward Python interface for [OpenML](http://openml.org), an online platform for open science collaboration in machine learning.
@@ -94,7 +94,7 @@ Bibtex entry:
9494
We welcome contributions from both new and experienced developers!
9595

9696
If you would like to contribute to OpenML-Python, please read our
97-
[Contribution Guidelines](https://github.com/openml/openml-python/blob/develop/CONTRIBUTING.md).
97+
[Contribution Guidelines](https://github.com/openml/openml-python/blob/main/CONTRIBUTING.md).
9898

9999
If you are new to open-source development, a great way to get started is by
100100
looking at issues labeled **"good first issue"** in our GitHub issue tracker.

openml/config.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727

2828
OPENML_CACHE_DIR_ENV_VAR = "OPENML_CACHE_DIR"
2929
OPENML_SKIP_PARQUET_ENV_VAR = "OPENML_SKIP_PARQUET"
30+
OPENML_TEST_SERVER_ADMIN_KEY_ENV_VAR = "OPENML_TEST_SERVER_ADMIN_KEY"
3031
_TEST_SERVER_NORMAL_USER_KEY = "normaluser"
3132

3233

openml/evaluations/functions.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,8 +231,9 @@ def __list_evaluations(api_call: str) -> list[OpenMLEvaluation]:
231231
f'Error in return XML, does not contain "oml:evaluations": {evals_dict!s}',
232232
)
233233

234-
assert isinstance(evals_dict["oml:evaluations"]["oml:evaluation"], list), type(
235-
evals_dict["oml:evaluations"],
234+
assert isinstance(evals_dict["oml:evaluations"]["oml:evaluation"], list), (
235+
"Expected 'oml:evaluation' to be a list, but got"
236+
f"{type(evals_dict['oml:evaluations']['oml:evaluation']).__name__}. "
236237
)
237238

238239
uploader_ids = list(

0 commit comments

Comments
 (0)