Skip to content

Move tests to root dir. Minor setup refactoring #211

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

Merged
merged 1 commit into from
Sep 16, 2019

Conversation

roaffix
Copy link
Contributor

@roaffix roaffix commented Sep 4, 2019

IMO, there is no purpose to keep and deliver tests/within the package. It has no use cases here and it makes pkg even dirtier than it is now. So, I made a small PR that moves out tests/ to the root directory. There are minor changes were made according to the PEP-8.
I added missing requirements.txt file and added minor changes to setup.py.
Also, I think it would be better to extend max-line-length from default 79 symbols to 119 symbols because your API requires a lot of arguments that make functions too long. 119 symbols will decrease the extra amount of lines in the future.

@@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/env python
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

requirements.txt Outdated
@@ -0,0 +1,6 @@
setuptools==40.6.2
numba==0.45.1
numpy==1.17.1
Copy link
Contributor

Choose a reason for hiding this comment

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

I would like to move toward pipenv. I don't like these pinned dependencies. How did you determine the versions? Are they minimum supported. pipenv would solve all of these.

module_name = None
num_args = len(sys.argv)

if (num_args > 1):
if num_args > 1:
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

display_func(a)
print_func(a.elements(), a.type(), a.dims(), a.numdims())
print_func(a.is_empty(), a.is_scalar(), a.is_column(), a.is_row())
print_func(a.is_complex(), a.is_real(), a.is_double(), a.is_single())
print_func(a.is_real_floating(), a.is_floating(), a.is_integer(), a.is_bool())

a = af.Array(host.array('I', [7, 8, 9] * 3), (3,3))
a = af.Array(host.array("I", [7, 8, 9] * 3), (3, 3))
Copy link
Contributor

Choose a reason for hiding this comment

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

Subjective: I dislike double quotes for a "char"-like string.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If AF lib won't be extended with modules for web-dev, so it's okay to change all quotes to single and in another case, it'd be better to use double. But what's the point of quotes mixing? It decreases readability and adds chaos a bit into a code style.

@syurkevi
Copy link
Contributor

syurkevi commented Sep 9, 2019

Moving the tests to the root directory is a good move. Once we figure out the pipenv this should be good to merge.

@roaffix
Copy link
Contributor Author

roaffix commented Sep 9, 2019

TBH I'm not sure if requirements should even be added in this PR. The feature with binaries link (see added TODO by original maintainer) will require an update for all python wrapper dependencies. But it was added just to follow recommendations for python project structure. So, I can remove them at all for now and the project will still work just fine.

@umar456
Copy link
Member

umar456 commented Sep 9, 2019

Everything looks good to me. I agree that the requirements.txt file is not required because its mostly for tests and interop functionality.

@roaffix roaffix force-pushed the feature/move-tests-to-rootdir branch from f27f419 to 632cb8f Compare September 9, 2019 22:58
@roaffix
Copy link
Contributor Author

roaffix commented Sep 9, 2019

Removed requirements.txt from this PR

@syurkevi syurkevi merged commit d22f60f into arrayfire:master Sep 16, 2019
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