Skip to content

Commit

Permalink
Add copyright headers along with Furo license (Qiskit#464)
Browse files Browse the repository at this point in the history
## Adds Furo license

It's extra safe to do this because we vendor about 6 files from Furo. 

We use the prior art of Pytorch of including the license directly in
`LICENSE` at the bottom. Pytorch is also an MIT license and we
substantially vendored it, so it's a similar setup.

## Fixes LICENSE inclusion

The switch to `pyproject.toml` accidentally changed us including the
LICENSE file to instead have the text `Apache 2`.

## Adds copyright file headers

We should have been doing this from the start because Qiskit projects
are expected to put copyright headers on every file. This becomes
especially useful if we more substantially vendor Furo code in
Qiskit#463 to make clear
what is what.

All files that are originally written by Qiskit contributors use the
standard Apache 2 license we already use in this project.

Meanwhile, files that are vendored from Furo now use this standard
notice:

> This file is vendored from Furo (created by Pradyun Gedam) and used
under the MIT license.

Even though the MIT license does not require file headers, and Furo
itself does not use it, it is a good practice to make clear what
originally comes from Furo.

## Also renames `search_sidebar.html`

This file is vendored from Furo, but we had it under
`custom_templates/search_sidebar.html` rather than the original
`sidebar/search.html`. This PR renames the file so that we more properly
attribute Furo and the MIT license.
  • Loading branch information
Eric-Arellano committed Jul 6, 2023
1 parent 7dc0e2c commit c1e848c
Show file tree
Hide file tree
Showing 44 changed files with 524 additions and 20 deletions.
8 changes: 6 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,12 @@ We try to keep changes to a minimum because every divergence we make from base F
Copy the HTML template from Furo and save it in the same file path. Then, at the top of the file, add this header:

```
{#- This file is vendored from Furo. When adding custom Qiskit code, surround it with
`QISKIT CHANGE: start` and `QISKIT CHANGE: end` Jinja-style comments. -#}
{#-
This file is vendored from Furo (created by Pradyun Gedam) and used under the MIT license.
When adding custom Qiskit code, surround it with `QISKIT CHANGE: start` and
`QISKIT CHANGE: end` Jinja-style comments.
-#}
```

When making changes, use those comments to make clear where and what we changed. For example:
Expand Down
12 changes: 12 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
# This code is part of Qiskit.
#
# (C) Copyright IBM 2023.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative works of this code must retain this
# copyright notice, and modified files need to carry a notice indicating
# that they have been altered from the originals.

# This Dockerfile is used to preview the docs in pull requests via GitHub Actions.
#
# To test it out locally:
Expand Down
23 changes: 23 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -224,3 +224,26 @@ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


The MIT License (MIT)

Copyright (c) 2020 Pradyun Gedam <[email protected]>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
IN THE SOFTWARE.
13 changes: 13 additions & 0 deletions playwright.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
/* This code is part of Qiskit.
*
* (C) Copyright IBM 2023.
*
* This code is licensed under the Apache License, Version 2.0. You may
* obtain a copy of this license in the LICENSE.txt file in the root directory
* of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
*
* Any modifications or derivative works of this code must retain this
* copyright notice, and modified files need to carry a notice indicating
* that they have been altered from the originals.
*/

import { defineConfig } from "@playwright/test";

const baseURL = "http://127.0.0.1:8080";
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ name = "qiskit-sphinx-theme"
description = "A Sphinx theme for Qiskit and Qiskit Ecosystem projects"
dynamic = ["version"]

license = { text = "Apache 2" }
license = { file = "LICENSE" }
authors = [{ name = "Qiskit Development Team", email = "[email protected]" }]
classifiers = [
"Development Status :: 5 - Production/Stable",
Expand Down
2 changes: 1 addition & 1 deletion src/qiskit_sphinx_theme/assets/scripts/gumshoe-patched.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Vendored exactly from Furo's `assets/scripts/gumshoe-patched.js`.
/*! This file is vendored from Furo (created by Pradyun Gedam) and used under the MIT license. */
/*!
* gumshoejs v5.1.2 (patched by @pradyunsg)
* A simple, framework-agnostic scrollspy script.
Expand Down
4 changes: 2 additions & 2 deletions src/qiskit_sphinx_theme/assets/scripts/qiskit-sphinx-theme.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This file is vendored from Furo's `assets/scripts/furo.js`. When adding custom Qiskit code,
// surround it with `QISKIT CHANGE: start` and `QISKIT CHANGE: end` comments.
/*! This file is vendored from Furo (created by Pradyun Gedam) and used under the MIT license. */
// When making changes, surround it with `QISKIT CHANGE: start` and `QISKIT CHANGE: end` comments.

import Gumshoe from "./gumshoe-patched.js";

Expand Down
13 changes: 13 additions & 0 deletions src/qiskit_sphinx_theme/assets/styles/_admonitions.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
/* This code is part of Qiskit.
*
* (C) Copyright IBM 2023.
*
* This code is licensed under the Apache License, Version 2.0. You may
* obtain a copy of this license in the LICENSE.txt file in the root directory
* of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
*
* Any modifications or derivative works of this code must retain this
* copyright notice, and modified files need to carry a notice indicating
* that they have been altered from the originals.
*/

// We use https://carbondesignsystem.com/components/notification/style/ for admonitions
// (e.g. warning boxes. We don't use the Success admonition though.

Expand Down
13 changes: 13 additions & 0 deletions src/qiskit_sphinx_theme/assets/styles/_api.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
/* This code is part of Qiskit.
*
* (C) Copyright IBM 2023.
*
* This code is licensed under the Apache License, Version 2.0. You may
* obtain a copy of this license in the LICENSE.txt file in the root directory
* of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
*
* Any modifications or derivative works of this code must retain this
* copyright notice, and modified files need to carry a notice indicating
* that they have been altered from the originals.
*/

// By default, Furo uses an aggressive red color for API docs. We use a more muted black and gray.
body {
--color-api-name: var(--color-foreground-primary);
Expand Down
13 changes: 13 additions & 0 deletions src/qiskit_sphinx_theme/assets/styles/_custom-directives.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
/* This code is part of Qiskit.
*
* (C) Copyright IBM 2023.
*
* This code is licensed under the Apache License, Version 2.0. You may
* obtain a copy of this license in the LICENSE.txt file in the root directory
* of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
*
* Any modifications or derivative works of this code must retain this
* copyright notice, and modified files need to carry a notice indicating
* that they have been altered from the originals.
*/

// This creates a purple border at the bottom. We set the width to 0. The relevant rule
// should change the width to 100% on hover so that it transitions in.
@mixin purple-underline {
Expand Down
13 changes: 13 additions & 0 deletions src/qiskit_sphinx_theme/assets/styles/_drop-shadows.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
/* This code is part of Qiskit.
*
* (C) Copyright IBM 2023.
*
* This code is licensed under the Apache License, Version 2.0. You may
* obtain a copy of this license in the LICENSE.txt file in the root directory
* of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
*
* Any modifications or derivative works of this code must retain this
* copyright notice, and modified files need to carry a notice indicating
* that they have been altered from the originals.
*/

// We use a flat design with Carbon, so disable box-shadows and rounded borders.
//
// `:not(#specifity-war)` is to work around specifity wars.
Expand Down
13 changes: 13 additions & 0 deletions src/qiskit_sphinx_theme/assets/styles/_footer.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
/* This code is part of Qiskit.
*
* (C) Copyright IBM 2023.
*
* This code is licensed under the Apache License, Version 2.0. You may
* obtain a copy of this license in the LICENSE.txt file in the root directory
* of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
*
* Any modifications or derivative works of this code must retain this
* copyright notice, and modified files need to carry a notice indicating
* that they have been altered from the originals.
*/

.qiskit-analytics-container {
display: inline-flex;
border-top: 1px solid var(--color-background-border);
Expand Down
13 changes: 13 additions & 0 deletions src/qiskit_sphinx_theme/assets/styles/_icons.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
/* This code is part of Qiskit.
*
* (C) Copyright IBM 2023.
*
* This code is licensed under the Apache License, Version 2.0. You may
* obtain a copy of this license in the LICENSE.txt file in the root directory
* of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
*
* Any modifications or derivative works of this code must retain this
* copyright notice, and modified files need to carry a notice indicating
* that they have been altered from the originals.
*/

// We must use Carbon for all icons: https://carbondesignsystem.com/guidelines/icons/library/.
// To use an icon, download it and format it to one line.
//
Expand Down
13 changes: 13 additions & 0 deletions src/qiskit_sphinx_theme/assets/styles/_layout.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
/* This code is part of Qiskit.
*
* (C) Copyright IBM 2023.
*
* This code is licensed under the Apache License, Version 2.0. You may
* obtain a copy of this license in the LICENSE.txt file in the root directory
* of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
*
* Any modifications or derivative works of this code must retain this
* copyright notice, and modified files need to carry a notice indicating
* that they have been altered from the originals.
*/

// By default, Furo expands the left and right sidebars when the page width increases, but it
// doesn't increase the entry size. It also keeps the page contents fixed at 46em.
//
Expand Down
13 changes: 13 additions & 0 deletions src/qiskit_sphinx_theme/assets/styles/_left-sidebar.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
/* This code is part of Qiskit.
*
* (C) Copyright IBM 2023.
*
* This code is licensed under the Apache License, Version 2.0. You may
* obtain a copy of this license in the LICENSE.txt file in the root directory
* of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
*
* Any modifications or derivative works of this code must retain this
* copyright notice, and modified files need to carry a notice indicating
* that they have been altered from the originals.
*/

// ------------------------------------------------------------------------------
// Colors
// ------------------------------------------------------------------------------
Expand Down
13 changes: 13 additions & 0 deletions src/qiskit_sphinx_theme/assets/styles/_sphinx-extensions.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
/* This code is part of Qiskit.
*
* (C) Copyright IBM 2023.
*
* This code is licensed under the Apache License, Version 2.0. You may
* obtain a copy of this license in the LICENSE.txt file in the root directory
* of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
*
* Any modifications or derivative works of this code must retain this
* copyright notice, and modified files need to carry a notice indicating
* that they have been altered from the originals.
*/

// ---------------------------------------------------------------------------
// nbsphinx (tutorials)
// ---------------------------------------------------------------------------
Expand Down
13 changes: 13 additions & 0 deletions src/qiskit_sphinx_theme/assets/styles/_tables.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
/* This code is part of Qiskit.
*
* (C) Copyright IBM 2023.
*
* This code is licensed under the Apache License, Version 2.0. You may
* obtain a copy of this license in the LICENSE.txt file in the root directory
* of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
*
* Any modifications or derivative works of this code must retain this
* copyright notice, and modified files need to carry a notice indicating
* that they have been altered from the originals.
*/

body {
// Use the same table header color as qiskit.org.
--color-table-header-background: #dde1e6;
Expand Down
13 changes: 13 additions & 0 deletions src/qiskit_sphinx_theme/assets/styles/_top-nav-bar.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
/* This code is part of Qiskit.
*
* (C) Copyright IBM 2023.
*
* This code is licensed under the Apache License, Version 2.0. You may
* obtain a copy of this license in the LICENSE.txt file in the root directory
* of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
*
* Any modifications or derivative works of this code must retain this
* copyright notice, and modified files need to carry a notice indicating
* that they have been altered from the originals.
*/

// This value is duplicated from `top-nav-bar.js`. Its definition of the variable is not
// exposed globally. Keep in sync.
//
Expand Down
13 changes: 13 additions & 0 deletions src/qiskit_sphinx_theme/assets/styles/_typography.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
/* This code is part of Qiskit.
*
* (C) Copyright IBM 2023.
*
* This code is licensed under the Apache License, Version 2.0. You may
* obtain a copy of this license in the LICENSE.txt file in the root directory
* of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
*
* Any modifications or derivative works of this code must retain this
* copyright notice, and modified files need to carry a notice indicating
* that they have been altered from the originals.
*/

body {
--font-stack: 'IBM Plex Sans', 'Roboto', 'Helvetica Neue', 'Arial', sans-serif;
--font-stack--monospace: 'IBM Plex Mono', 'Consolas', 'Courier New', monospace;
Expand Down
13 changes: 13 additions & 0 deletions src/qiskit_sphinx_theme/assets/styles/qiskit-sphinx-theme.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
/* This code is part of Qiskit.
*
* (C) Copyright IBM 2023.
*
* This code is licensed under the Apache License, Version 2.0. You may
* obtain a copy of this license in the LICENSE.txt file in the root directory
* of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
*
* Any modifications or derivative works of this code must retain this
* copyright notice, and modified files need to carry a notice indicating
* that they have been altered from the originals.
*/

@import "admonitions";
@import "api";
@import "custom-directives";
Expand Down
14 changes: 14 additions & 0 deletions src/qiskit_sphinx_theme/pytorch/breadcrumbs.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
{#-
This code is part of Qiskit.

(C) Copyright IBM 2023.

This code is licensed under the Apache License, Version 2.0. You may
obtain a copy of this license in the LICENSE.txt file in the root directory
of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.

Any modifications or derivative works of this code must retain this
copyright notice, and modified files need to carry a notice indicating
that they have been altered from the originals.
-#}

<div role="navigation" aria-label="breadcrumbs navigation">

<ul class="pytorch-breadcrumbs">
Expand Down
14 changes: 14 additions & 0 deletions src/qiskit_sphinx_theme/pytorch/footer.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
{#-
This code is part of Qiskit.

(C) Copyright IBM 2023.

This code is licensed under the Apache License, Version 2.0. You may
obtain a copy of this license in the LICENSE.txt file in the root directory
of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.

Any modifications or derivative works of this code must retain this
copyright notice, and modified files need to carry a notice indicating
that they have been altered from the originals.
-#}

<footer>
<!-- USER FEEDBACK -->
{% if analytics_enabled %}
Expand Down
14 changes: 14 additions & 0 deletions src/qiskit_sphinx_theme/pytorch/languages.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
{#-
This code is part of Qiskit.

(C) Copyright IBM 2023.

This code is licensed under the Apache License, Version 2.0. You may
obtain a copy of this license in the LICENSE.txt file in the root directory
of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.

Any modifications or derivative works of this code must retain this
copyright notice, and modified files need to carry a notice indicating
that they have been altered from the originals.
-#}

{% if translations_list %}
<div class="rst-versions" data-toggle="rst-versions" role="note" aria-label="versions">
<span class="rst-current-version" data-toggle="rst-current-version">
Expand Down
14 changes: 14 additions & 0 deletions src/qiskit_sphinx_theme/pytorch/layout.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
{#-
This code is part of Qiskit.

(C) Copyright IBM 2023.

This code is licensed under the Apache License, Version 2.0. You may
obtain a copy of this license in the LICENSE.txt file in the root directory
of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.

Any modifications or derivative works of this code must retain this
copyright notice, and modified files need to carry a notice indicating
that they have been altered from the originals.
-#}

{# Sphinx template variable setup #}
{%- if not embedded and docstitle %}
{%- set titlesuffix = " &mdash; "|safe + docstitle|e %}
Expand Down
Loading

0 comments on commit c1e848c

Please sign in to comment.