Skip to content

Commit

Permalink
Move "include" directory to project (#1560)
Browse files Browse the repository at this point in the history
# Description

## What is the current behavior?

See the referenced issue for details.

closes: #1440 

## What is the new behavior?

After reading python-poetry/poetry#2015, it
seems the best solution is to include the "include" directory directly
in the project.

## Does this introduce a breaking change?

No.

### Checklist
- [x] Created tests which fail without the change (if possible)
- [ ] Extended the README / documentation, if necessary
  • Loading branch information
feluelle authored and utkarsharma2 committed Jan 17, 2023
1 parent 34877aa commit de97f0f
Show file tree
Hide file tree
Showing 19 changed files with 6 additions and 15 deletions.
7 changes: 2 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,8 @@ sql-cli/tests/.airflow/dags/*
!sql-cli/tests/.airflow/dags/sql/.gitkeep
!sql-cli/tests/.airflow/dags/.gitkeep

# Generated examples
sql-cli/include/base/.airflow/dags/*
!sql-cli/include/base/.airflow/dags/include/.gitkeep
!sql-cli/include/base/.airflow/dags/.gitkeep
!/sql-cli/include/base/.env
# Un-ignore .env file for sql-cli users
!sql-cli/sql_cli/include/base/.env

# Airflow
**/.airflowignore
Expand Down
3 changes: 0 additions & 3 deletions sql-cli/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ classifiers = [
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
]
include=[
{ path = 'include', format = 'wheel' }
]

[project.urls]
Home = "https://astronomer.io/"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion sql-cli/sql_cli/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
remove_unnecessary_files,
)

BASE_SOURCE_DIR = Path(os.path.realpath(__file__)).parent.parent / "include/base/"
BASE_SOURCE_DIR = Path(os.path.realpath(__file__)).parent / "include/base/"

MANDATORY_PATHS = {
Path("config/default/configuration.yml"),
Expand Down
9 changes: 3 additions & 6 deletions sql-cli/tests/test_configuration.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
from pathlib import Path

from sql_cli.configuration import Config
from sql_cli.project import BASE_SOURCE_DIR


def test_from_yaml_to_config():
config_reference = Config(
project_dir=Path(__file__).parent.parent / "include/base", environment="default"
)
config_reference = Config(project_dir=BASE_SOURCE_DIR, environment="default")
config_from_file = config_reference.from_yaml_to_config()
assert isinstance(config_from_file, Config)
assert config_from_file.project_dir == config_reference.project_dir
Expand All @@ -15,7 +12,7 @@ def test_from_yaml_to_config():


def test_from_yaml_to_config_without_env():
config_reference = Config(project_dir=Path(__file__).parent.parent / "include/base")
config_reference = Config(project_dir=BASE_SOURCE_DIR)
config_from_file = config_reference.from_yaml_to_config()
assert isinstance(config_from_file, Config)
assert config_from_file.project_dir == config_reference.project_dir
Expand Down

0 comments on commit de97f0f

Please sign in to comment.