Skip to content

Commit

Permalink
Enforce copyright/license disclaimer & encoding pragma (conda#11183)
Browse files Browse the repository at this point in the history
* Enforce copyright/license disclaimer

* Include encoding pragma hook

* Remove old license blurbs

* Ignore conda/auxlib/_vendor

* Apply

* Move disclaimer.txt to .github/
  • Loading branch information
kenodegard authored Feb 1, 2022
1 parent e0f7f14 commit 35cd479
Show file tree
Hide file tree
Showing 98 changed files with 353 additions and 18 deletions.
2 changes: 2 additions & 0 deletions .github/disclaimer.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Copyright (C) 2012 Anaconda, Inc
SPDX-License-Identifier: BSD-3-Clause
23 changes: 22 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# generally speaking we ignore all vendored code as well as tests data
exclude: ^(conda/_vendor|tests/data/(conda_format_repo|env_metadata/.+|legacy_repodata|repodata|tar_traversal|corrupt))/
exclude: |
(?x)^(
conda/_vendor |
conda/auxlib/_vendor |
tests/data/(
conda_format_repo |
env_metadata/.+ |
legacy_repodata |
repodata |
tar_traversal |
corrupt
)
)/
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
Expand All @@ -14,6 +26,8 @@ repos:
exclude: ^(conda\.)?recipe/meta.yaml
# catch git merge/rebase problems
- id: check-merge-conflict
- id: fix-encoding-pragma
exclude: ^conda/auxlib/
- repo: https://github.com/akaihola/darker
rev: github-action-v1.3.2-2
hooks:
Expand All @@ -40,3 +54,10 @@ repos:
args: [--exit-zero]
# ignore all tests, not just tests data
exclude: ^tests/
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.1.11
hooks:
- id: insert-license
files: \.py$
args: [--license-filepath, .github/disclaimer.txt]
exclude: ^conda/auxlib/
3 changes: 3 additions & 0 deletions conda/cli/main_run.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause

from __future__ import absolute_import, division, print_function, unicode_literals

from logging import getLogger
Expand Down
3 changes: 3 additions & 0 deletions conda/cli/parsers.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
2 changes: 1 addition & 1 deletion conda/common/cuda.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2019 Anaconda, Inc
# Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause

def cuda_detect():
Expand Down
4 changes: 4 additions & 0 deletions conda/common/decorators.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause

import os


Expand Down
8 changes: 3 additions & 5 deletions docs/scrape_help.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
#!/usr/bin/env python
# (c) 2012-2013 Anaconda, Inc. / http://continuum.io
# All Rights Reserved
#
# conda is distributed under the terms of the BSD 3-clause license.
# Consult LICENSE.txt or http://opensource.org/licenses/BSD-3-Clause.
# -*- coding: utf-8 -*-
# Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause

from subprocess import check_output, PIPE, Popen, STDOUT
from os.path import join, dirname, abspath, isdir
Expand Down
9 changes: 4 additions & 5 deletions docs/source/_ext/conda_umls.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
#!/usr/bin/env python
# (c) 2021 Anaconda, Inc.
# All Rights Reserved
#
# conda is distributed under the terms of the BSD 3-clause license.
# Consult LICENSE.txt or http://opensource.org/licenses/BSD-3-Clause.
# -*- coding: utf-8 -*-
# Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause

import fileinput
import os
import requests
Expand Down
3 changes: 3 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause

#
# conda documentation build configuration file, created by
# sphinx-quickstart on Wed Aug 16 00:33:55 2017.
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause

Expand Down
4 changes: 4 additions & 0 deletions tests/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause

# This is just here so that tests is a package, so that dotted relative
# imports work.
from __future__ import print_function
Expand Down
3 changes: 3 additions & 0 deletions tests/base/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
3 changes: 3 additions & 0 deletions tests/base/test_constants.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause

from __future__ import absolute_import, division, print_function, unicode_literals

from conda.base.constants import ChannelPriority
Expand Down
3 changes: 3 additions & 0 deletions tests/base/test_context.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause

from __future__ import absolute_import, division, print_function, unicode_literals

from itertools import chain
Expand Down
4 changes: 4 additions & 0 deletions tests/cases.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause

import unittest
import pytest

Expand Down
3 changes: 3 additions & 0 deletions tests/cli/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
4 changes: 4 additions & 0 deletions tests/cli/test_cli_install.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause

import tempfile
from unittest import TestCase
from tests.test_create import run_command, Commands
Expand Down
3 changes: 3 additions & 0 deletions tests/cli/test_common.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause

from __future__ import absolute_import, division, print_function, unicode_literals

import os
Expand Down
3 changes: 3 additions & 0 deletions tests/cli/test_conda_argparse.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause

from __future__ import absolute_import, division, print_function, unicode_literals

from logging import getLogger
Expand Down
9 changes: 4 additions & 5 deletions tests/cli/test_config.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# (c) 2012-2014 Continuum Analytics, Inc. / http://continuum.io
# All Rights Reserved
#
# conda is distributed under the terms of the BSD 3-clause license.
# Consult LICENSE.txt or http://opensource.org/licenses/BSD-3-Clause.
# -*- coding: utf-8 -*-
# Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause

import os
import pytest

Expand Down
3 changes: 3 additions & 0 deletions tests/cli/test_main_info.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause

from __future__ import absolute_import, division, print_function, unicode_literals

import json
Expand Down
3 changes: 3 additions & 0 deletions tests/common/os/test_windows.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause

from __future__ import absolute_import, division, print_function, unicode_literals

from conda.common.compat import on_win
Expand Down
3 changes: 3 additions & 0 deletions tests/common/test_configuration.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause

from __future__ import absolute_import, division, print_function, unicode_literals

from conda.common.io import env_var, env_vars
Expand Down
3 changes: 3 additions & 0 deletions tests/common/test_io.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause

from __future__ import absolute_import, division, print_function, unicode_literals

from conda.common.io import attach_stderr_handler, captured, CaptureTarget
Expand Down
3 changes: 3 additions & 0 deletions tests/common/test_path.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause

from __future__ import absolute_import, division, print_function, unicode_literals

from logging import getLogger
Expand Down
3 changes: 3 additions & 0 deletions tests/common/test_url.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause

from __future__ import absolute_import, division, print_function, unicode_literals

from logging import getLogger
Expand Down
3 changes: 3 additions & 0 deletions tests/common/test_yaml.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause

from __future__ import absolute_import, division, print_function, unicode_literals

from logging import getLogger
Expand Down
4 changes: 4 additions & 0 deletions tests/conda_env/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause

from os.path import dirname, join


Expand Down
3 changes: 3 additions & 0 deletions tests/conda_env/installers/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
4 changes: 4 additions & 0 deletions tests/conda_env/installers/test_pip.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause

import unittest
try:
from unittest import mock
Expand Down
3 changes: 3 additions & 0 deletions tests/conda_env/specs/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
4 changes: 4 additions & 0 deletions tests/conda_env/specs/test_base.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause

from contextlib import contextmanager
import random
import types
Expand Down
4 changes: 4 additions & 0 deletions tests/conda_env/specs/test_binstar.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause

import types
import unittest
try:
Expand Down
4 changes: 4 additions & 0 deletions tests/conda_env/specs/test_notebook.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause

import unittest
from conda_env import env
from conda_env.specs.notebook import NotebookSpec
Expand Down
4 changes: 4 additions & 0 deletions tests/conda_env/specs/test_requirements.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause

import unittest

from .. import utils
Expand Down
4 changes: 4 additions & 0 deletions tests/conda_env/specs/test_yaml_file.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause

import unittest
import random
try:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause

from setuptools import setup

setup(
Expand Down
4 changes: 4 additions & 0 deletions tests/conda_env/test_cli.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause

import json
import os
import yaml
Expand Down
3 changes: 3 additions & 0 deletions tests/conda_env/test_create.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause

from __future__ import absolute_import, division, print_function

from logging import Handler, getLogger
Expand Down
4 changes: 4 additions & 0 deletions tests/conda_env/test_env.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause

from collections import OrderedDict
import os
from os.path import join
Expand Down
4 changes: 4 additions & 0 deletions tests/conda_env/test_pip_util.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause

import pytest
from conda_env.pip_util import get_pip_installed_packages

Expand Down
4 changes: 4 additions & 0 deletions tests/conda_env/utils.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause

from argparse import ArgumentParser
from contextlib import contextmanager
from tempfile import mkdtemp
Expand Down
4 changes: 4 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause

from functools import partial
import os
import sys
Expand Down
3 changes: 3 additions & 0 deletions tests/core/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
3 changes: 3 additions & 0 deletions tests/core/test_envs_manager.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause

from __future__ import absolute_import, division, print_function, unicode_literals

from logging import getLogger
Expand Down
3 changes: 3 additions & 0 deletions tests/core/test_index.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause

from __future__ import absolute_import, division, print_function, unicode_literals

from logging import getLogger
Expand Down
3 changes: 3 additions & 0 deletions tests/core/test_initialize.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause

from __future__ import absolute_import, division, print_function, unicode_literals

from distutils.sysconfig import get_python_lib
Expand Down
4 changes: 4 additions & 0 deletions tests/core/test_install.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause

# from os.path import join
#
# import pytest
Expand Down
Loading

0 comments on commit 35cd479

Please sign in to comment.