-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Remove hardcoded copyright year #3616
Remove hardcoded copyright year #3616
Conversation
@@ -10,7 +14,7 @@ source_parsers = { | |||
} | |||
master_doc = 'index' | |||
project = u'{{ project.name }}' | |||
copyright = u'2016' | |||
copyright = datetime.now().year |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this expected to be a string somewhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like yes!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting that all the tests pass but this simple change breaks all the builds p:
docs/conf.py
Outdated
@@ -33,7 +36,9 @@ | |||
|
|||
master_doc = 'index' | |||
project = u'Read the Docs' | |||
copyright = u'2010-2017, Read the Docs, Inc & contributors' | |||
copyright = '2010-{}, Read the Docs, Inc & contributors'.format( | |||
datetime.now().year |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of using python datetime
, use django timezone
. It have timezone aware time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we don't depends on Django for building the RTD documentation. So, you will probably need another way to achieve this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@humitos for the rtd docs django
is imported, for the generated conf.py
for empty projects it's not, and probably it's ok using plain datetime there, since is just a year and only used for projects without a conf.py
file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Take a look at the timezone comment raised by @safwanrahman. Anyway, this PR is too much better that we already have.
docs/conf.py
Outdated
@@ -33,7 +36,9 @@ | |||
|
|||
master_doc = 'index' | |||
project = u'Read the Docs' | |||
copyright = u'2010-2017, Read the Docs, Inc & contributors' | |||
copyright = '2010-{}, Read the Docs, Inc & contributors'.format( | |||
datetime.now().year |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we don't depends on Django for building the RTD documentation. So, you will probably need another way to achieve this.
@humitos I update to use django timezone on the rtd docs, for the other template see #3616 (comment) |
@@ -10,7 +14,7 @@ source_parsers = { | |||
} | |||
master_doc = 'index' | |||
project = u'{{ project.name }}' | |||
copyright = u'2016' | |||
copyright = str(datetime.now().year) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although, should be better to generate this on template parse time (using {{ some_year }}) rather than build time?
I don't think the timezone matters for this simple PR. Let's not overengineer solutions, and try to ship things that are simple. |
No description provided.