Skip to content

Commit

Permalink
Added copyright file header to all files, version 0.1.34
Browse files Browse the repository at this point in the history
  • Loading branch information
mbnshtck committed Sep 19, 2018
1 parent 7b2fbb0 commit 7423237
Show file tree
Hide file tree
Showing 32 changed files with 323 additions and 28 deletions.
Binary file modified .vs/KqlMagic/v15/.suo
Binary file not shown.
74 changes: 74 additions & 0 deletions CODE_OF_CONDUCT.md
@@ -0,0 +1,74 @@
# Contributor Covenant Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, gender identity and expression, level of experience,
nationality, personal appearance, race, religion, or sexual identity and
orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment
include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
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 python@microsoft.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.
Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at [http://contributor-covenant.org/version/1/4][version]

[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/
9 changes: 9 additions & 0 deletions CONTRIBUTING.md
@@ -0,0 +1,9 @@
# Contributing to KqlMagic

If you would like to become an active contributor to this project please
follow the instructions provided in [Microsoft Azure Projects Contribution Guidelines](http://azure.github.io/guidelines/).

## Code of Conduct
This project's code of conduct can be found in the
[CODE_OF_CONDUCT.md file](https://github.com/Microsoft/jupyter-Kqlmagic/blob/master/CODE_OF_CONDUCT.md)
(v1.4.0 of the http://contributor-covenant.org/ CoC).
4 changes: 3 additions & 1 deletion KqlMagic.pyproj
Expand Up @@ -18,7 +18,8 @@
<VisualStudioVersion Condition=" '$(VisualStudioVersion)' == '' ">10.0</VisualStudioVersion>
</PropertyGroup>
<ItemGroup>
<Content Include="csvfile" />
<Content Include="CODE_OF_CONDUCT.md" />
<Content Include="CONTRIBUTING.md" />
<Content Include="dev_requirements.txt" />
<Content Include="HACKING.txt" />
<Content Include="HISTORY.rst" />
Expand All @@ -32,6 +33,7 @@
</ItemGroup>
<ItemGroup>
<Compile Include="azure_bdist_wheel.py" />
<Compile Include="build_packages.py" />
<Compile Include="setup.py" />
<Compile Include="src\kql\ai_client.py" />
<Compile Include="src\kql\ai_engine.py" />
Expand Down
74 changes: 74 additions & 0 deletions build_packages.py
@@ -0,0 +1,74 @@
# -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------

import argparse
import os
from subprocess import check_call
from pathlib import Path
from six import text_type


try:
from packaging.version import parse as Version, InvalidVersion
except ImportError: # Should not happen, but at worst in most case this is the same
from pip._vendor.packaging.version import parse as Version, InvalidVersion

default_destination_folder = os.path.join("..", "dist")
package_list = ["Kqlmagic"]


def create_package(name, dest_folder=default_destination_folder):
absdirpath = os.path.abspath(name)
check_call(["python", "setup.py", "bdist_wheel", "-d", dest_folder], cwd=absdirpath)
check_call(["python", "setup.py", "sdist", "-d", dest_folder], cwd=absdirpath)


def travis_build_package():
"""Assumed called on Travis, to prepare a package to be deployed
This method prints on stdout for Travis.
Return is obj to pass to sys.exit() directly
"""
travis_tag = os.environ.get("TRAVIS_TAG")
if not travis_tag:
print("TRAVIS_TAG environment variable is not present")
return "TRAVIS_TAG environment variable is not present"

try:
version = Version(travis_tag)
except InvalidVersion:
failure = "Version must be a valid PEP440 version (version is: {})".format(version)
print(failure)
return failure

abs_dist_path = Path(os.environ["TRAVIS_BUILD_DIR"], "dist")
[create_package(package, text_type(abs_dist_path)) for package in package_list]

print("Produced:\n{}".format(list(abs_dist_path.glob("*"))))

pattern = "*{}*".format(version)
packages = list(abs_dist_path.glob(pattern))
if not packages:
return "Package version does not match tag {}, abort".format(version)
pypi_server = os.environ.get("PYPI_SERVER", "default PyPI server")
print("Package created as expected and will be pushed to {}".format(pypi_server))


if __name__ == "__main__":
parser = argparse.ArgumentParser(description="Build Azure package.")
parser.add_argument("name", help="The package name")
parser.add_argument(
"--dest",
"-d",
default=default_destination_folder,
help="Destination folder. Relative to the package dir. [default: %(default)s]",
)

args = parser.parse_args()
if args.name == "all":
for package in package_list:
create_package(package, args.dest)
else:
create_package(args.name, args.dest)
8 changes: 8 additions & 0 deletions setup.py
@@ -1,3 +1,11 @@
#!/usr/bin/env python

#-------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#--------------------------------------------------------------------------

"""Setup for Kqlmagic"""

DESCRIPTION = "Kqlmagic: KQL (Kusto Query Language) execution via Jupyter magic"
Expand Down
6 changes: 6 additions & 0 deletions src/kql/__init__.py
@@ -1,3 +1,9 @@
#-------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#--------------------------------------------------------------------------

from .kql_magic import *
from .version import VERSION

Expand Down
6 changes: 6 additions & 0 deletions src/kql/ai_client.py
@@ -1,3 +1,9 @@
#-------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#--------------------------------------------------------------------------

import six
from datetime import timedelta, datetime
import re
Expand Down
6 changes: 6 additions & 0 deletions src/kql/ai_engine.py
@@ -1,3 +1,9 @@
#-------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#--------------------------------------------------------------------------

import os.path
import re
from kql.kql_engine import KqlEngine, KqlEngineError
Expand Down
6 changes: 6 additions & 0 deletions src/kql/column_guesser.py
@@ -1,3 +1,9 @@
#-------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#--------------------------------------------------------------------------

from datetime import timedelta, datetime


Expand Down
6 changes: 6 additions & 0 deletions src/kql/connection.py
@@ -1,3 +1,9 @@
#-------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#--------------------------------------------------------------------------

import os
from kql.kql_engine import KqlEngineError
from kql.kusto_engine import KustoEngine
Expand Down
6 changes: 6 additions & 0 deletions src/kql/database_html.py
@@ -1,3 +1,9 @@
#-------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#--------------------------------------------------------------------------

from kql.display import Display
from kql.kusto_engine import KustoEngine
from kql.ai_engine import AppinsightsEngine
Expand Down
5 changes: 5 additions & 0 deletions src/kql/display.py
@@ -1,3 +1,8 @@
#-------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#--------------------------------------------------------------------------

import uuid
from IPython.core.display import display, HTML
Expand Down
6 changes: 6 additions & 0 deletions src/kql/file_client.py
@@ -1,3 +1,9 @@
#-------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#--------------------------------------------------------------------------

from kql.kusto_client import KustoResponse
import hashlib
import json
Expand Down
6 changes: 6 additions & 0 deletions src/kql/file_engine.py
@@ -1,3 +1,9 @@
#-------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#--------------------------------------------------------------------------

import re
import os

Expand Down
6 changes: 6 additions & 0 deletions src/kql/help_html.py
@@ -1,3 +1,9 @@
#-------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#--------------------------------------------------------------------------

import time
from IPython.core.display import display
from IPython.core.magics.display import Javascript
Expand Down
6 changes: 6 additions & 0 deletions src/kql/kql_engine.py
@@ -1,3 +1,9 @@
#-------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#--------------------------------------------------------------------------

from kql.kql_proxy import KqlResponse


Expand Down
6 changes: 6 additions & 0 deletions src/kql/kql_magic.py
@@ -1,3 +1,9 @@
#-------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#--------------------------------------------------------------------------

import os
import time
import logging
Expand Down
6 changes: 6 additions & 0 deletions src/kql/kql_proxy.py
@@ -1,3 +1,9 @@
#-------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#--------------------------------------------------------------------------

import six
import json
from kql.display import Display
Expand Down
6 changes: 6 additions & 0 deletions src/kql/kusto_client.py
@@ -1,3 +1,9 @@
#-------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#--------------------------------------------------------------------------

import six
from datetime import timedelta, datetime
import re
Expand Down
6 changes: 6 additions & 0 deletions src/kql/kusto_engine.py
@@ -1,3 +1,9 @@
#-------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#--------------------------------------------------------------------------

import re
import getpass

Expand Down
6 changes: 6 additions & 0 deletions src/kql/la_client.py
@@ -1,3 +1,9 @@
#-------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#--------------------------------------------------------------------------

import six
from datetime import timedelta, datetime
import re
Expand Down
6 changes: 6 additions & 0 deletions src/kql/la_engine.py
@@ -1,3 +1,9 @@
#-------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#--------------------------------------------------------------------------

import re
from kql.kql_engine import KqlEngine, KqlEngineError
from kql.la_client import LoganalyticsClient
Expand Down
31 changes: 5 additions & 26 deletions src/kql/log.py
@@ -1,29 +1,8 @@
# ------------------------------------------------------------------------------
#
# Copyright (c) Microsoft Corporation.
# All rights reserved.
#
# This code is licensed under the MIT License.
#
# 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 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.
#
# ------------------------------------------------------------------------------
#-------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#--------------------------------------------------------------------------

import logging
import uuid
Expand Down

0 comments on commit 7423237

Please sign in to comment.