Pendulum has a nice feature that allows you to make a function call on a Pendulum object to automatically get a pre-formatted, common string (e.g. a cookie time string). See this page for examples: https://pendulum.eustace.io/docs/#common-formats.
Hi, I am interested in working on this issue. I forked the repository, cloned that repo, and ran "pip install -U arrow". It seems to successfully install, but when I try to run some of the test files, I get various errors with import packages. I am wondering if this is normal, or if we have done something wrong in setup.
_Examples of some issues:_
"Traceback (most recent call last):
File "tests/test_parser.py", line 17, in
from .utils import make_full_tz_list
ImportError: attempted relative import with no known parent package"
"Traceback (most recent call last):
聽聽File "test_factory.py", line 12, in
聽聽聽聽from .utils import assert_datetime_equality
ModuleNotFoundError: No module named '__main__.utils'; '__main__' is not a package"
My friend, @ikoningstein, is working on this with me. Thank you in advance!
Hey @rbandrews3, by doing pip install -U Arrow, you are installing the packaged version from PyPi (which is not updated in real time when you make local changes). Since you are developing the package locally, you need to simply execute the pytest test cases like this:
make build37 # replace with whatever python version you have on your system
pytest -v tests # this assumes you are in the root arrow directory
Or, you can use Tox (recommended) since this handles creating the virtual environment and installing the dependencies for you:
pip install -U tox
tox
The tox step runs linting and runs the tests on available python versions that are installed on your system.
Does that help? Let me know if you are still unable to get it working.
Thanks so much! We got the library running smoothly now. @rbandrews3 and I read through the documentation on the Pendulum common formatting, and want to confirm that this feature requires the implementation of the following functions.
Thanks!
You do not have to implement all of them if you do not want to, so you can make a call on which of the functions you would like to implement based on the workload. These functions will most likely live in the Arrow formatterformat.py.
Maybe just start with the most common RFC's and the cookie one.
Hi! I'm working on a different issue but had the same question as @rbandrews3 above! I cloned the repo and am trying to figure out how to build it but I am struggling a little - running the make command is not working and I'm not sure if I'm missing any build steps or installations. Do you have steps to share on how to properly build and run the code?
@amylavar1 after installing arrow, we ran the tox commands that jad posted instead of the make commands and this worked for us! It鈥檚 the second comment on this post.
Hi! I'm working on a different issue but had the same question as @rbandrews3 above! I cloned the repo and am trying to figure out how to build it but I am struggling a little - running the make command is not working and I'm not sure if I'm missing any build steps or installations. Do you have steps to share on how to properly build and run the code?
@amylavar1 No problem. I should definitely create some getting started documentation in the future, but here is what I recommend:
Rather than cloning the repo, you need to fork it and clone your fork. Once you fork it, you can create a branch on your forked copy of the repo and that is what you can PR into this official repository.
Also, like Rebecca stated, we recommend using Tox as it is cross platform and works across Windows, Mac, and Linux. You simply need to run tox to run all the tests and linting operations on all python versions that are available on your machine. If you know you have a particular python version (e.g. 3.8), you can run tox -e py38.
@jadchaar Hi! So I tried to follow and run the tox commands but I am getting an invocation error when I run tox -e py27.
@jadchaar Hi! So I tried to follow and run the tox commands but I am getting an invocation error when I run tox -e py27.
Do you get this error when you just run tox without the environment argument?
Yes I get the same errors running tox alone
@amylavar1 do you think you can make a new issue thread here and we can continue this debugging conversation there? In your post, please include a screenshot or a copy of the terminal output you are receiving.
Yup, it's here: https://github.com/crsmithdev/arrow/issues/771
Done in #791
Most helpful comment
Hi, I am interested in working on this issue. I forked the repository, cloned that repo, and ran "pip install -U arrow". It seems to successfully install, but when I try to run some of the test files, I get various errors with import packages. I am wondering if this is normal, or if we have done something wrong in setup.
_Examples of some issues:_
"Traceback (most recent call last):
File "tests/test_parser.py", line 17, in
from .utils import make_full_tz_list
ImportError: attempted relative import with no known parent package"
"Traceback (most recent call last):
聽聽File "test_factory.py", line 12, in
聽聽聽聽from .utils import assert_datetime_equality
ModuleNotFoundError: No module named '__main__.utils'; '__main__' is not a package"
My friend, @ikoningstein, is working on this with me. Thank you in advance!