Skip to content

Commit

Permalink
Merge pull request #231 from painebot/tkp/overhaul
Browse files Browse the repository at this point in the history
overhaul packaging and project layout, bring in line with templates, first pass for fsspec
  • Loading branch information
timkpaine authored Feb 18, 2025
2 parents 6f5d03f + 3a0b0c4 commit bd33e32
Show file tree
Hide file tree
Showing 68 changed files with 10,491 additions and 11,137 deletions.
16 changes: 0 additions & 16 deletions .bumpversion.cfg

This file was deleted.

10 changes: 10 additions & 0 deletions .copier-answers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Changes here will be overwritten by Copier
_commit: '9689455'
_src_path: https://github.com/python-project-templates/base.git
add_extension: jupyter
email: [email protected]
github: jpmorganchase
project_description: A Filesystem-like mult-contents manager backend for Jupyter
project_name: jupyter-fs
python_version_primary: '3.9'
team: the jupyter-fs authors
12 changes: 11 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
examples/* linguist-documentation
docs/* linguist-documentation
*.ipynb linguist-documentation
Makefile linguist-documentation

* text=auto eol=lf
*.css text=auto eol=lf
*.html text=auto eol=lf
*.js text=auto eol=lf
*.json text=auto eol=lf
*.less text=auto eol=lf
*.md text=auto eol=lf
*.py text=auto eol=lf
*.toml text=auto eol=lf
*.ts text=auto eol=lf
*.yml text=auto eol=lf
2 changes: 1 addition & 1 deletion .github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ further defined and clarified by project maintainers.
## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at open_source@jpmorgan.com. All
reported by contacting the project team at t.paine154@gmail.com. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Expand Down
23 changes: 4 additions & 19 deletions CONTRIBUTING.md → .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,12 @@ If you have any questions about the contribution process, please feel free to se

### Install

Note: You will need NodeJS to build the extension package.
Note: You will need NodeJS and `pnpm` to build the extension package.

```bash
pip install -e .[dev]
```

The `jlpm` command is JupyterLab's pinned version of
[yarn](https://yarnpkg.com/) that is installed with JupyterLab. You may use
`yarn` or `npm` in lieu of `jlpm` below.

```bash
# Clone the repo to your local environment
# Change directory to the jupyter-fs directory
# Install package in development mode
jlpm
cd js
jlpm build
cd ..
jlpm develop
```

### Configure

You'll need to set the contents manager class in the jupyter server config. Paste the following json into your config:
Expand All @@ -57,14 +42,14 @@ After you make a change to the Typescript sources, you can rebuild jupyter-fs on

```bash
# Rebuild extension Typescript source after making changes
(cd js; jlpm run build)
(cd js; pnpm run build)
```

You can watch the source directory and run JupyterLab at the same time in different terminals to watch for changes in the extension's source and automatically rebuild the extension.

```bash
# Watch the source directory in one terminal, automatically rebuilding when needed
(cd js; jlpm run watch)
(cd js; pnpm run watch)
# Run JupyterLab in another terminal
jupyter lab
```
Expand All @@ -73,7 +58,7 @@ With the watch command running, every saved change will immediately be built loc

### Sourcemaps

By default, the `jlpm run build` command generates the source maps for this extension to make it easier to debug using the browser dev tools. To also generate source maps for the JupyterLab core extensions, you can run the following command:
By default, the `pnpm run build` command generates the source maps for this extension to make it easier to debug using the browser dev tools. To also generate source maps for the JupyterLab core extensions, you can run the following command:

```bash
jupyter lab build --minimize=False
Expand Down
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ updates:
- "part: dependencies"

- package-ecosystem: "npm"
directory: "/"
directory: "/js"
schedule:
interval: "monthly"
labels:
Expand Down
65 changes: 33 additions & 32 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@ on:
tags:
- v*
paths-ignore:
- docs/
- AUTHORS
- CONTRIBUTING.md
- LICENSE
- README.md
pull_request:
branches:
- main
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

permissions:
contents: read
checks: write
pull-requests: write

Expand All @@ -29,9 +29,9 @@ jobs:

strategy:
matrix:
os: [ubuntu-latest]
python-version: [3.9]
node-version: [18.x]
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.9"]
node-version: [20.x]

steps:
- uses: actions/checkout@v4
Expand All @@ -47,12 +47,13 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'
cache-dependency-path: js/yarn.lock

- name: Install yarn
run: npm install -g yarn


- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9
package_json_file: js/package.json

- name: Install dependencies
run: make develop

Expand All @@ -61,7 +62,7 @@ jobs:
if: ${{ matrix.os == 'ubuntu-latest' }}

- name: Setup Mac testing infra
run: make setup-infra-mac
run: sudo make setup-infra-mac
if: ${{ matrix.os == 'macos-latest' }}

- name: Setup Windows testing infra
Expand All @@ -73,14 +74,18 @@ jobs:

- name: Lint
run: make lint
if: matrix.os == 'ubuntu-latest'

- name: Checks
run: make checks
if: ${{ matrix.os == 'ubuntu-latest' }}
if: matrix.os == 'ubuntu-latest'

- name: Build
run: make build

- name: Test
run: make tests
if: ${{ matrix.os == 'ubuntu-latest' }}
run: make coverage
if: matrix.os == 'ubuntu-latest'

- name: Teardown Linux testing infra
run: make teardown-infra-ubuntu DOCKER_COMPOSE="docker compose"
Expand All @@ -100,26 +105,22 @@ jobs:
- name: Upload test results (Python)
uses: actions/upload-artifact@v4
with:
name: pytest-results-${{ matrix.os }}-${{ matrix.python-version }}
path: junit.xml
if: ${{ always() }}

- name: Upload test results (JS)
uses: actions/upload-artifact@v4
with:
name: jstest-results-${{ matrix.os }}-${{ matrix.python-version }}
path: js/junit.xml
name: test-results-${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.node-version }}
path: '**/junit.xml'
if: ${{ always() }}

- name: Publish Unit Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
with:
files: |
**/junit.xml
if: ${{ matrix.os == 'ubuntu-latest' }}

- name: Upload coverage
uses: codecov/codecov-action@v5
files: '**/junit.xml'
if: matrix.os == 'ubuntu-latest'

- name: Twine check
- name: Make dist
run: make dist
if: matrix.os == 'ubuntu-latest'

- uses: actions/upload-artifact@v4
with:
name: dist-${{matrix.os}}
path: dist
if: matrix.os == 'ubuntu-latest'
Loading

0 comments on commit bd33e32

Please sign in to comment.