Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up tox ini #105

Merged
merged 73 commits into from
Feb 24, 2021
Merged

Clean up tox ini #105

merged 73 commits into from
Feb 24, 2021

Conversation

JCZuurmond
Copy link
Contributor

As discussed in #103, here some suggestion to change the use of setup.py, requirements.txt and tox.ini. I think we should merge #103 first and sync this with that one.

@@ -1,9 +1,5 @@
dbt-core==0.19.0
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these were duplicate, i.e. already present in setup.py

requirements.txt Outdated
@@ -1,9 +1,5 @@
dbt-core==0.19.0
pyodbc>=4.0.27
azure-identity>=1.4.0
black~=20.8b1
pytest-dbt-adapter~=0.4.0
tox==3.2.0
flake8>=3.5.0
certifi==2020.6.20
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this used in the package? Or something like tox and flake, i.e. used when developing the package.

tox.ini Outdated
@@ -1,18 +1,6 @@
[tox]
skipsdist = True
envlist = unit, flake8, integration-sqlserver, integration-synapse
envlist = py37,py38
Copy link
Contributor Author

@JCZuurmond JCZuurmond Feb 11, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

our test suite is ran for python 3.7 and 3.8

.circleci/config.yml Show resolved Hide resolved
@@ -1,9 +1,6 @@
dbt-core==0.19.0
pyodbc>=4.0.27
azure-identity>=1.4.0
black~=20.8b1
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I renamed it to dev_requirements since it are the packages you need to install for local development. Dbt also has a dev_requirements.txt

tox.ini Outdated
[testenv]
commands = pytest {posargs}
deps = pytest~=6.2.2 pytest-dbt-adapter~=0.4.0
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these are the test dependencies

dev_requirements.txt Outdated Show resolved Hide resolved
@@ -6,7 +6,9 @@ orbs:

jobs:
integration-sqlserver: &sqlserver
docker:
docker:
- image: cimg/python:3.7
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need this to run testing for multiple python versions

@JCZuurmond
Copy link
Contributor Author

@swanderz : When I try to install multiple python versions the CI does not work. Could you help?

dev_requirements.txt Outdated Show resolved Hide resolved
setup.py Outdated
@@ -57,8 +57,8 @@ def _dbt_sqlserver_version():
]
},
install_requires=[
'dbt-core~=0.19.0',
"dbt-core>=0.19.0",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fairly certain that we want to keep the tilde character bc (according to this SO answer), it is a combination of to a combination of the following clauses:

  • >= 0.19.0 and
  • == 0.19.*

This way a user will get an error if they try to install dbt-core==0.20.0 before we cut a compatible release.

Copy link
Contributor Author

@JCZuurmond JCZuurmond Feb 14, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, that is true. Though, we might miss when there is a new minor version and thus forget to leverage that.

The projects I use as examples - like [tox](https://github.com/tox-dev/tox/blob/master/setup.cfg) or [pre-commit](https://github.com/pre-commit/pre-commit/blob/master/setup.cfg) - have lower bounded requirement version. Sometimes you see an upper bound for the major release dbt-core>=0.19.0,<1.0.0.

I think the idea is that dbt-core should be backwards compatible for minor releases, however, it could of course happen that that is not the case.

I will change it back to the ~ for now.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point. no strong opinion here. @mikaelene might have one though!

@dataders
Copy link
Collaborator

When I try to install multiple python versions the CI does not work. Could you help?

for "unauthorized" issue, there's a setting that should is already enabled for this repo: Pass secrets to builds from forked pull requests. In the docs for this feature, it does bring up this scenario. Are you by chance "following" your fork from your personal GitHub account rather than from the dbt-msft org? My view looks like below, with dbt-msft in the top left...

Note: If a user submits a pull request to your repository from a fork, but no pipeline is triggered, then the user most likely is following a project fork on their personal account rather than the project itself of CircleCi, causing the jobs to trigger under the user’s personal account and not the organization account. To resolve this issue, have the user unfollow their fork of the project on CircleCI and instead follow the source project. This will trigger their jobs to run under the organization when they submit pull requests.

image

https://circleci.com/docs/2.0/oss/#example-open-source-projects

Copy link
Collaborator

@dataders dataders left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

totally on board with this clean up. next steps (as I see them):

.circleci/config.yml Outdated Show resolved Hide resolved
tox.ini Outdated Show resolved Hide resolved
.circleci/config.yml Show resolved Hide resolved
.circleci/config.yml Show resolved Hide resolved
tox.ini Outdated Show resolved Hide resolved
@JCZuurmond JCZuurmond requested a review from dataders February 15, 2021 16:52
.circleci/config.yml Outdated Show resolved Hide resolved
Copy link
Collaborator

@dataders dataders left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we're ready to merge. much cleaner now IMHO. @mikaelene -- I approve!

@dataders dataders requested a review from mikaelene February 23, 2021 22:51
Copy link
Collaborator

@mikaelene mikaelene left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not a tox expert. Looks good to me and the tests seems to work. Always good to clean things up :-). We don't have that much code to keep clean.

.circleci/config.yml Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants